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.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Sam Saffron
  • 887
  • 10
  • 16

7 Answers7

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
user169309
  • 81
  • 1
  • 1
6

urxvt supports clickable links.

dshepherd
  • 300
  • 2
  • 6
  • 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. – ephemient Jul 21 '09 at 01:27
  • ephemient: thanks for changing to the *real* link :) –  Jul 21 '09 at 01:28
  • Yerp this is the only one that I could get to work. Its pretty tricky to set up. – Sam Saffron Jul 21 '09 at 02:34
  • *How* did you get it to work then? I am having the same problem, but the second links is unreachable at the moment –  Jan 18 '13 at 17:59
  • Hey, any clear answer? I still can't figure out how to config my terminal. – Rohman HM Aug 27 '17 at 00:40
0

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

  • Would you know how I activate it for local links ? – Sam Saffron Jul 21 '09 at 01:33
  • I think you could use the gnome configuration editor, see http://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. –  Jul 21 '09 at 01: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

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

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

sendmoreinfo
  • 2,533
  • 21
  • 36
Tim Kennedy
  • 19,369
  • 4
  • 38
  • 58
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.

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
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.

mchid
  • 1,421
  • 2
  • 15
  • 21