0

I turn off enable-bracketed-paste feature whenever I log in into my bash, and I need to access a remote server which had not turned it off system wide.

Many time, this is what I'm getting before I've logged in:

ssh [email protected]
The authenticity of host 'my.remote' can't be established.
RSA key fingerprint is SHA256:B/Iv...Augs.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? ^[[200~yes^[[201~
Please type 'yes', 'no' or the fingerprint: ^[[200~yes^[[201~^C

IE. Paste wraps the text in special characters so that certain applications will see that this is pasted text and will handle it properly. However, the remote terminal is not handling this correctly sometimes, and is therefore not removing the weird characters. Apparently this paste mode is called the "Bracketed Paste Mode" http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Bracketed-Paste-Mode

I've turned it off at my local terminal, but the above is what I'm getting when ssh into my remote server from my local terminal.

Moreover, I cannot paste in my lo~~~ng password either, because of this very reason.

As tink pointed out, turning it off system wide for my Linux (Ubuntu) is here, however something I don't have access for system wide configuration, and in such case, how should I deal-with / fix-for the case when pasting anything into terminal, the ^[[200~...^[[201~ wrapping text shows up, in step of the pasted text show up as inverted.

Need to fix it for the above case, and for pasting in my lo~~~ng password.

3
  • I'm not quite sure why your bash on the server would be doing this by default, but does this answer your question? And were you really pasting yes? :D
    – tink
    Aug 17, 2023 at 21:14
  • Ah, yes! that answers my question, and yes, I was really pasting yes, as you can tell from the brackets. Thanks!
    – xpt
    Aug 17, 2023 at 21:59
  • There's no concept of turning it off "system-wide". The way it's supposed to work: each and every applicataion enables it if it's able to handle those special characters, and turns it off before exiting, or, in case of the shell, turns it off before starting the requested program and turns it back on when presenting the next prompt. I.e. it's constantly being toggled on and off. So ssh should begin with bracketed paste mode being off, and it should really not turn it on, unless it can handle it (which I highly doubt). You'd need to debug where and why whole this story goes wrong.
    – egmont
    Aug 23, 2023 at 14:17

0

You must log in to answer this question.

Browse other questions tagged .