On 2014-01-29 21:03:12 -0700, Bob Proulx wrote: > Eduardo A. Bustamante López wrote: > > Chris Down wrote: > > > Well, you can do this with PROMPT_COMMAND='sleep 1'. I don't see the > > > need for another internal variable to do this. > > > > How would that work to avoid filling the prompt with the paste buffer > > when I fat finger and paste a whole email to the prompt? It will just > > slow down the process, but not cancel it. > > It would give you plenty of time to hit Control-C to interrupt it. > Try it and you will see.
Yeah, that's what I had in mind. The one thing worth mentioning is that the first line will still get executed immediately. PROMPT_COMMAND is run just before PS1 is printed. One way to get around this is to use the debug trap instead: shopt -s extdebug trap 'sleep 1' DEBUG
pgp_8wA6L1pN1.pgp
Description: PGP signature