Terminal: Selection not deselected when you press 'Esc'

Created on 7 May 2019  ·  4Comments  ·  Source: microsoft/terminal

When there is a selection of one or more character places, pressing "Esc" should clear the selection as it does in vanilla cmd.exe.

The selection does clear if you press "Esc" and resize the window, triggering rerender.

Adding:

if(!handled && vkey == 27) { this->_renderer->TriggerRedrawAll(); }
to here:
https://github.com/microsoft/Terminal/blob/b726a3d05d35928becc8313f6ac5536c9f503645/src/cascadia/TerminalControl/TermControl.cpp#L512 fixed it, but that is just a thoughtless hack to remove the small annoyance for now.

Issue-Bug

Most helpful comment

Oh yea, that does it. Woah that's weird, but definitely helps narrow the problem down. Thanks for the tip!

All 4 comments

That's odd - pressing escape repaints perfectly fine for me.

Though, that's probably not where I'd put the fix. Wherever the selection is being dismissed on input (probably Terminal.cpp) should also do a TriggerSelection.

In my experience, avoiding TriggerRedrawAll is a good idea, if at all possible.

Sorry, forgot to mention this is running wsl.exe under Terminal.

cmd.exe under Terminal works as expected

Oh yea, that does it. Woah that's weird, but definitely helps narrow the problem down. Thanks for the tip!

Just noticed the problem in Powershell too. 🤷‍♀️

Was this page helpful?
0 / 5 - 0 ratings