How do I paste multiple command lines in one go?

How can I get multi line pasting of commands working again in gdb?

Hmm something has changed with copy/paste between

GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1


GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1

No idea about intermediates – I didn’t do the "upgrade".

It seems that when I paste multiple lines through windows putty on the newer release, the lines are treated as a single block, that then requires an enter. On older releases each line was processed immediately.

The command-line seems to treat the block as separate commands, as you would expect.

But gdb is not happy, treating the whole block as a single command in some way.

I have developed this habit of building simple ad-hoc scripts using a local editor, and ideally need a way to get this functionality back. Anyone found a fix? Perhaps something on the windows/terminal side?

I don’t really want to mess around with editors, functions, .gdinit files, on the unix side, when I can just see the three commands I want to do right in front of me!

Sort-of the point of debugging is 2 hours later any excess effort is wasted.

>Solution :

ssbssa is correct that this was caused by a readline update.

The feature in question is called bracketed-paste-mode.

To disable this I added the following line to my .inputrc:

set enable-bracketed-paste off

though this is going to turn the feature off for everything that uses readline, e.g. bash, which might not be what you want.

If you want to turn the feature off just for GDB then you can:

$if Gdb
set enable-bracketed-paste off

Leave a Reply