jschank
jschank

Reputation: 574

How do I prevent strange escape chars from appearing on prompt

I am using Cygwin on windows 7 mintty 2.3.6 (x86_64-pc-cygwin)

And randomly a [28~ will appear on my prompt line. Sometimes it even appears while I am in the middle of typing a command. And often it appears even when the terminal window doesn't have focus.

This is really hard to google for, because google just sees the 28. I would appreciate suggestions on how to improve my google-fu to search for the specific sequence.

Upvotes: 0

Views: 446

Answers (2)

mach
mach

Reputation: 195

For the record, there are two other ways to fix this:

  1. Prevent F15 from being interpreted on the mintty side: Add the following line to your mintty config file (e.g. ~/.minttyrc). It tells mintty to ignore F15 by itself or with the Ctrl modifier, which does the trick for me (on my machine, it would produce ~ by itself, and with Ctrl, ;5~):

    KeyFunctions=F15:void;C+F15:void
    
  2. Prevent Caffeine from sending F15 by running it with the -useshift option.

Upvotes: 0

Isaac Hanson
Isaac Hanson

Reputation: 1158

This can be caused by an application such as Caffeine, which stops your screensaver by pressing a key periodically (like F15 which has ansi sequence \[[28~) . You can stop the program or add an entry in your ~/.inputrc to ignore the sequence. in ~/.inputrc add the line:

"\e[28~":""

to remap F15 to nothing in the terminal.

Upvotes: 4

Related Questions