ls --hyperlink
With a compatible terminal you can then just click on results. Another nicety is making your shell prompt a link to the working directory.Haven’t seen a terminal that lets you drag the links but that sounds like a logical feature.
https://purpleidea.com/blog/2018/06/29/hyperlinks-in-gnome-t...
Here is a quick comparison if anyone needs: https://github.com/asdf8dfafjk/Terminal-Features/blob/main/F...
Wish some terminals would allow more "actions" on hyperlinks, maybe using right click, and even drag-drop
Ctrl-clicking opens the link, but is anything supposed to happen when I click on the link (in Gnome Terminal). I thought it might copy the link, but nope.
I added this the first cut of this feature to iTerm2 about a decade ago because I often work in the terminal, but sometimes need to reference files elsewhere in my workflow. The feature was named "Semantic History" although in hindsight, it's not a very good name.
To use, hold Cmd and click+drag the path to where you want to drop it. Behind the scenes, the current working directory is stored with the position of the buffer, so it works on relative paths even when you change your working directory. On Cmd+Drag, it searches the buffer around the cursor until it finds a valid path to work with.
I've quickly tried to drag and drop file from another directory earlier from the history to the terminal itself, but it was converted to "cd directory" command somehow.
dragon is great. goes very nicely with emacs/dired!
On macos you have the 'open <path>' command, which is equivalent to double clicking that <path> object, whether it be a folder, file or application; you can also drag a folder/file to the terminal to paste it's path. No context menu <open terminal here> by default, but I think there are add one which do that.
I quickly thought “wait, remember that only works on macOS” and the was shocked to see KDE’s Dolphin open the directory. I dig into it and found there was an alias for ‘open’ to ‘xdg-open’
Nice
Hence the command had to be named `xdg-open`. Until, more recently, someone decided it was a stupid situation, so `open` was renamed `openvt`, and `open` is now an alias for `xdg-open`.
In case you're interested, I wrote some examples on how the system clipboard is also a great integrator for migrating data to and from the CLI: https://github.com/niedzielski/cb#examples
It is an OK workflow IMO. I'm not sure if I can directly drag and drop from the terminal list somehow. Or better yet, a full keyboard workflow.
Is it just me? I swear I see this on three different distros. Highlight in terminal/program X, paste to <pick any terminal>, and half the time it just does not work/gibberish/crash and burn.
I'm still under Xorg (running GNOME) for now, I'll move to Wayland when the benefits outweigh the costs, which I don't think is the case for me yet.