1

I use Putty (v0.77) on Windows 10 to access a bunch of remote Linux virtual servers. There's a strange difference in terminal behavior between servers running Ubuntu 20.04 Focal (or Debian Buster, for that matter) and Ubuntu 22.04 Jammy (or Debian Bullseye). (I'll stick with the Focal/Jammy terminology to avoid confusion).

The difference has to do with pasting text to the command line with Putty; in particular, how newlines are handled. With Focal, text is echoed to the command line and processed one line at a time, but with Jammy, it's somehow buffered and acted on all at once. As an example, consider the following text in the Windows clipboard:

echo 1
echo 2
echo 3

(Note, there is a trailing newline in that). If I paste that in the Putty window that's connected to a Focal server, I get:

ras@ubuntu2004:~$ echo 1
1
ras@ubuntu2004:~$ echo 2
2
ras@ubuntu2004:~$ echo 3
3
ras@ubuntu2004:~$

However, when I paste that same text to a Jammy server, first off, nothing happens until I hit the Return key, and then I get:

ras@ubuntu2204:~$ echo 1
echo 2
echo 3
1
2
3
ras@ubuntu2204:~$

Interestingly, this doesn't happen with all ssh clients; for example, using the command line client in WSL, the bahavior is the same between Focal an Jammy (both Ubuntu versions behave like the Focal example above). So it's not strictly something that changed in Jammy, it's some kind of interaction between Putty and a change in Jammy. It also has something to do with Bash - if I use sh, both Ubuntu versions also behave the same with Putty (although also interestingly, they both behave more like the Jammy example above - except that you don't have to hit the Return key before anything happens.)

So now I'm down a rabbit hole trying to figure out what causes the difference in behavior, but I really don't even know where to start looking.

EDIT: this was closed as a dupe of Pasted text in Gnome Terminal in 21.04 is always highlighted - it's true that the resolution for this is the same as that question, but it's yet another case of only being able to find the question if you already know the answer.

ras
  • 13

0 Answers0