22

Is there a terminal emulator (extension or app) that does link resolution for local paths?

In particular when I see things like:

/home/sam/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/home/sam/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/home/sam/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17:in `ms'

I would like to be able to click on:

/home/sam/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb

To open the file.

1
  • 2
    Emacs + ffap, maybe? Not sure how much work it would be to set up. Commented Feb 2, 2013 at 2:12

7 Answers 7

8

Here is a simple script to help put local file names into a format which are ctl-clickable from within Gnome-Terminal.

#!/bin/bash
function asURL() {
        PREFIX="file://$(pwd)/";
        sed "s*^*$PREFIX*" |
        sed 's/ /%20/g'; 
}
find "$@" | asURL

Examples,

furl *.pdf
furl -name \*.pdf
6

urxvt supports clickable links.

5
  • I cleaned up your first link target. Also, the configuration your second link points to doesn't handle links to local files, which OP apparently wants. While this is easy to add, you should detail this in your post. Commented Jul 21, 2009 at 1:27
  • ephemient: thanks for changing to the real link :) Commented Jul 21, 2009 at 1:28
  • Yerp this is the only one that I could get to work. Its pretty tricky to set up. Commented Jul 21, 2009 at 2:34
  • How did you get it to work then? I am having the same problem, but the second links is unreachable at the moment Commented Jan 18, 2013 at 17:59
  • Hey, any clear answer? I still can't figure out how to config my terminal. Commented Aug 27, 2017 at 0:40
0

gnome terminal (Ubuntu's default terminal app) has that feature.

2
  • Would you know how I activate it for local links ? Commented Jul 21, 2009 at 1:33
  • I think you could use the gnome configuration editor, see en.wikipedia.org/wiki/Gconf-editor -- or Mandrake's gconfpref, etc etc. No access to ubuntu right now (I'm at OSCON and my laptop's a mac;-) so I can't give detailed GUI-use tips. Commented Jul 21, 2009 at 1:55
0

You can sort-of accomplish what you want using xargs, gnome-open, and a simple script to filter the text so that the trailing detritus is removed. Basically, you could do something along the lines of:

compile | filtererrors | xargs gnome-open

Of course, you would have to write your own "filtererrors" program, but that shouldn't be too hard. Just read in each line. Find the first index of ':', and then print the line up to and excluding that index.

0

That looks like output to feed to vim -q, so in screen, you could map something that takes a hard copy of the screen and spawns a new screen window with vim -q on that file (where you can click all you want). For instance, add:

bind E eval hardcopy "screen zsh -c 'vim -q =(grep -E \^/.\*:\[0-9\]+: hardcopy.*(om[1]))'"

To your ~/.screenrc

And type Ctrl-AE to bring up a vim to browse those errors.

0

graphterm supports this. http://code.mindmeldr.com/graphterm/README.html

screenshots at http://code.mindmeldr.com/graphterm/screenshots.html

0

Guake has this feature. Right click anywhere in the text input area of Guake and then select Preferences.

From the Preferences window, it should be the second or third option from the bottom called fast links or something similar.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.