
On Fri, Jan 11, 2019 at 10:48:54PM -0500, Stewart Smith wrote:
The one thing I miss from screen is built in zmodem capture. Okay, so this is a bit esoteric these days, and I guess I should not complain about it and instead send a patch to tmux :)
I'd forgotten that screen could even do that. It's been years since I even used zmodem, possibly decades. Seems you're not the first to miss it: https://github.com/tmux/tmux/issues/906 https://github.com/tmux/tmux/issues/1439 The responses so far have been "No way, this is not what tmux is for" and "tmux has nothing to do with uploading files". The response may be more positive if accompanied by a working patch :) If you're going to send a patch, I'd suggest making two generic features rather than hard-coding support for zmodem. 1. Add an ability to allow tmux to run a program and pipe the output into the terminal. e.g. run "rz" inside the terminal and then have tmux run "sz filename" to upload a file. This would have many other uses, like running "vi" in the terminal and typing "i" or "o" in vi, then having tmux run "cat filename". 2. Add an ability to pipe all input from the terminal into a command until that command terminates. e.g. run "sz filename" in the terminal and then have "tmux" run "rz". For programs like rz that are able to detect the end of their input, this isn't terribly complicated, but it would be much more complicated for programs that just keep on hoovering up stdin until stdin closes - e.g. "cat filename" inside the terminal while tmux runs "xsel -i". Another tmux command to manually close the input to the running external program would be clumsy but workable. 3. An obvious third feature would be programmable triggers to run commands. e.g. if tmux sees a particular sequence of characters, then run a particular program. e.g. "**B00000000000000" could trigger running "rz". I expect that this would probably be quite difficult, and would probably have a noticable impact on tmux's performance. BTW, there's an ssh wrapper called zssh: Package: zssh Depends: lrzsz, openssh-client | telnet | telnet-ssl, libc6 (>= 2.27), libreadline7 (>= 6.0) Description-en: interactive file transfers over ssh zssh (Zmodem SSH) is a program for interactively transferring files to a remote machine while using the secure shell (ssh). It is intended to be a convenient alternative to scp, allowing to transfer files without having to open another session and re-authenticate oneself. . Files are transferred through the zmodem protocol, using the rz and sz commands. Homepage: http://zssh.sourceforge.net/ The main benefit I can see (for either zssh, or zmodem support in tmux) is that due to firewalls, NAT, etc it's often MUCH hard to connect back to the origin host with scp or ftp or whatever, than it was to connect from the origin host to the remote host in the first place. OTOH, that's one of the uses for ssh port-forwarding. There's a Q&A on stackoverflow showing how to do it even from within your current ssh session (i.e. without having to set up port-forwarding when you started ssh) with ssh tilde commands. https://stackoverflow.com/questions/25482099/how-to-scp-back-to-local-when-i... craig -- craig sanders <cas@taz.net.au>