terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Cannot create a binding to output Esc only

Open yerlaser opened this issue 1 year ago • 1 comments

Windows Terminal version

No response

Windows build number

No response

Other Software

No response

Steps to reproduce

Try to create a new binding to output Esc character (\x1B)

Expected Behavior

Pressing the binding should send Esc character to the app

Actual Behavior

Nothing gets sent, which in WSL can be confirmed by running cat program. Interestingly, it is possible to create a binding that sends Escape Sequences, e.g. Alt-q (\x1Bq), but not the Esc itself.

yerlaser avatar Aug 14 '24 17:08 yerlaser

Thanks for filing. As a workaround, you can set your sendInput sequence to \u001b[27;1;27;1;0;1_\u001b[27;1;27;0;0;1_. This sends it as a win32 input sequence.

As for solutions on our end:

  1. there's a bug where we drop escape characters at the end of the input chunk. They shouldn't get lost.
  2. add a timeout such that the escape characters are flushed out to the application.

carlos-zamora avatar Aug 14 '24 22:08 carlos-zamora