Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-05-05 11:27:21

twostepted
Member
Registered: 2020-05-05
Posts: 2

clickable file links in xfce4 terminal

xfce4 terminal makes hyperlinks clickable. Is there any way to make file links like this clickable?
./to/file.c:10:20
/path/to/file.c:10:20
I would like to have be able to click on them and have them open with $EDITOR or maybe some other environment variable.

If its not possible with xfcd4 terminal, can anyone recommend another terminal which does this?

Offline

#2 2020-05-05 15:27:18

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 138

Re: clickable file links in xfce4 terminal

I don't know if that would make sense since your in a terminal.

$editor /path/to/file

opens the file in the editor of your choice.

/path/to/file

and then click to open in $editor seem like extra steps to me.

Offline

#3 2020-05-06 09:25:17

alcornoqui
Member
Registered: 2014-07-28
Posts: 644

Re: clickable file links in xfce4 terminal

LOL, I've never seen clickable file links in terminal.

As an example, none of the answers here suggests anything like that, all of them are some form of what eriefisher said.

edit: Welcome to the forum, twostepted!

Last edited by alcornoqui (2020-05-06 09:26:03)

Offline

#4 2020-05-06 11:15:03

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,574

Re: clickable file links in xfce4 terminal

echo "file:///var/log/Xorg.0.log"

...then Control+click on the "file:///...." link. (It should open in your default editor).

However, to OP's question, it only works if the filename is presented in the format above and it does not work with line/character indicators - so you won't be able to jump to a specific place in the text. I'm don't think make can present the file in that format.

I'm unaware of a terminal that does this.

Offline

#5 2020-05-06 17:34:27

codenamepicnic
Member
Registered: 2020-04-23
Posts: 3

Re: clickable file links in xfce4 terminal

The embedded terminal in VSCode does this, but only in the context of that IDE.

Offline

#6 2020-05-08 14:42:45

twostepted
Member
Registered: 2020-05-05
Posts: 2

Re: clickable file links in xfce4 terminal

Thank you all for your responses.  I didn't notice them until now as I turned off form emails when I registered (oops).

I do use vscode so maybe i can get used to its terminal. 

@eriefisher I'm not sure what you mean.  I'm really just looking for quick ways to open file links from the terminal with a particular editor (vim, kakoune, vscode).  I don't want to have to do additional clicking or enter commands during development.  In fact i'd prefer no clicking and be able to use the keyboard. 

@alcornoqui hyperlinks and file:// links are already clickable.  Maybe there is some way to create a plugin which turns file paths into file:// links.

Offline

#7 2020-05-08 16:41:02

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 138

Re: clickable file links in xfce4 terminal

I'm not a keyboard warrior but it seems to me that if I just tell the editor to open a file would be faster than navigating to it then clicking on it. If the file is in the current directory the there is no navigation. ie with vim:

vim filename

By default file paths are not "links" as you know. You would still have to somehow enter the path for a link to be created or somehow select the file then have it converted to a link. This type of behavior does exist in Thunar. In the address bar, if you enter the file path and hit enter it will open in your preferred editor. There it makes sense and is usable.

Maybe I'm not understanding the question?

Offline

Board footer

Powered by FluxBB