4

I'm always SSHing to servers, sometimes it's over TOR, sometimes it's a server that's far away and the latency is really high. Is there a way to buffer my key strokes locally before they are sent to the machine on the other end?

I'm often using the default Ubuntu terminal and the OSX terminal.

8
  • I don't understand why buffering your input would help with latency at all? I'd think you'd want each keystroke to be transmitted immediately?? Jul 6, 2011 at 20:38
  • 1
    @The Phoenix: Local line editing ("buffering") would make it easier to type command lines. High latency causes a big delay between pressing the key and having the letters appear, which is terribly inconvenient: I would sometimes enter a long command, wait up to two seconds for everything to be displayed, notice a ton of typos, kill and retype the whole line... With local editing, the keypresses would be visible instantly. Jul 6, 2011 at 21:19
  • Sending fewer packets means using less bandwidth. Over a sufficiently slow link, using less bandwidth means improved latency.
    – Flimzy
    Jul 6, 2011 at 21:19
  • @grawity - I see, well I suppose I get ya. I think in order for this to work, your ssh client MUST implement some kind of support for this. I'd look to the ssh man page on OSX - but maybe you've done that and maybe they didn't bother to document everything. Jul 6, 2011 at 21:23
  • 1
    I'm tempted to recommend typing in a text editor and then pasting into the terminal, but I would like a legitimate answer to your question myself. Jul 6, 2011 at 21:24

4 Answers 4

3

If you're looking for a better remote terminal experience over high latency and/or low throughput, I highly recommend you have a look at mosh.

1
  • This answer prompted me to try mosh, but it's not a drop-in replacement. So for others making the jump: adapt your existing ssh command to mosh by passing all of the ssh command except the user@host section into --ssh, so mosh --ssh="ssh -o StrictHostKeyChecking=no -i path/to/key.pem" user@some-host Sep 13, 2023 at 4:25
0

Old Telnet supported local line editing. I once ran telnet over SSH to try this feature but soon realized it being even worse - no cursor keys or ctrl-keys in editors or command-line.

CopyPaste is your friend or mounting directories.

0

This may work, but your interactive experience will be broken in several ways (e.g., no TAB-completion, no ability to interrupt with ^C on the remote host, etc.):

ssh -T remotehost /bin/bash --login -i

The -T option forces SSH not to allocate a pseudo-terminal, and it may cause the local ssh client to read a line at a time before transmitting.

0

The command flag -T does work, although a found better user experience is to be found with PUTTY. It has option for "local line editing" and "local echo"

The command string then only gets sent with 'Enter' key.

2
  • -T does not do "local line editing" or similar with OpenSSH (whihch comes with Ubuntu). -T is used to supress pseudo tty Allocation.
    – davidgo
    Mar 3, 2013 at 19:21
  • 1
    @davidgo He's not equating them.
    – Zenexer
    Aug 6, 2013 at 11:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .