-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DND of files #376
Comments
There is a new D library for wrapping libssh that would make the SCP portion much easier: |
Bonus point (even if I have no idea how that would work): enable [xyz]modem transfers for hosts over a serial line. |
With some extra ansi codes, it should be possible to support file operations it should be possible to support file operations from the terminal (drag to file manager, also right click operations: open file, open directory, copy file, copy location). The 3 bits of information needed [root] [directory] [filename] When you ssh to a new host, e.g. pi@raspberry, the ansi codes could tell the terminal the new remote root (and when you disconnect, revert it to file:///) Every time an app changes directory, it would send back the current directory, and every time a filename is displayed it is wrapped in codes to say it is a filename. The aim would be to be able to do this
And then be able to right click or drag the hello.txt to my local computer. Obviously patching everything to output the extra ansi codes is out of the question. |
@stuaxo It shouldn't need any special codes, triggers can already detect the user/host when you SSH to a host by parsing out the login prompt. |
How about knowing knowing that 'hello.txt' is a filename, in the directory /home/pi so that right clicking it can open gedit at ssh://pi@raspberry/home/pi/hello.txt Or be able open nautilus to ssh://pi@raspberry/home/pi/ ? |
You can configure the custom links to look for filename patterns, however at the moment it doesn't do variable substitution but it would be easy to extend. If you are interested in working on this feature let me know. |
I could be interested in starting a proof-of-concept... is terminix all written in D ? If I could make even, just a replacement |
Yes terminix is all written in D. I'm not following on the replacement for Here's what my current plan looks like: I think the easiest to implement is SCP'ing to the remote host via drag and drop onto the terminal. The drop event is already wired in terminal.d, right now all it does is paste the file name into the terminal. To take this further, you would need to prompt the user on drop rather to paste the file name or copy the files (copy if local, scp if remote). Ideally it could piggy back on top of the existing SSH connection to avoid authentication. SCP'ing out of the host is more tricky, but could be done by enhancing the custom links so that when a file name is clicked it again triggers the SCP process. This isn't ideal since it's a regex for detecting filenames, particularly standalone ones, is never going to be perfect. Once the user clicks the file, you'd prompt them where to save the file and then trigger the SCP process. There is a D library in comment 2 that links to a library that wraps libssh that might be useful for this. |
Ah, yes - I'm definitely talking about file operations from the terminal + be able to identify arbitrary files in places where regex might be hard (output of The custom OSC codes would make it unambiguous. Piggy backing the current SSH connection, it definitely opens some possibilities. I had a play with strace just now, and it shows that intercepting lstat can get back which files are accessed:
If this info was timestamped + got back terminx somehow then it might be good enough (at least to know what is a file from ls, mc and ranger). Also, realised that my feature dragging / file ops from the terminal is different than to the terminal, so apologies for hijacking the thread :) |
I dunno, if I want a remote file manager, I use a remote file manager... 🙃 |
I use a terminal and a file manager - sometimes at the same time, more integration can save fiddling around with highlighting, copying and pasting of filenames etc. |
To get consistent behavior in the shell will be so tricky though: |
I'm not sure there is a practical way of doing it for lxc or docker, it would be enough to popup a dialog,
Multiple layers of ssh should be possible via forwarding. We don't have to cover all kinds of endpoint to be useful initially (though architecting things in such a way that they can be added is probably an idea though). |
Please take a look at the hyperlink support #904. It takes a somewhat different approach (e.g. needs a patched |
Note, I am a very interested potential user of Tilix, but some things stop me from using it. One of them is dnd support. While I generally like the idea to add more creative drag and drop support, this would break everything I do (and need to do) with drag and drop and a terminal. I usually open some file managers for locations I work on and then compose command lines by entering some command and dragging files and folders from different parts of the gui to the terminal. In an ideal world, I would also have another window from where I could drag preconfigured text items (like commands) and a clipboard with draggable items. I would also like dragging selected text snippets from terminals into the current command line. I usually use the terminal for things I cannot do easier with other tools. Which is roughly 50% of my work. A drop could open a menu to choose which way of dragging should be executed. |
Now with #135 completed which depended on understanding local versus remote hosts, another cool feature to borrow from iterm2 is the dragging and dropping of files on to a terminal.
If the host is local, just copy it locally. If the host is remote, scp it to the remote host. I'm thinking a Ui similar to Nautilus (I.e. the button with the pie that fills in) would be cool here.
This would be a longer term enhancement.
The text was updated successfully, but these errors were encountered: