Skip to content

Commit

Permalink
[textinput] Do not assign ESC a special meaning on history search mode
Browse files Browse the repository at this point in the history
UNIX terminals, e.g. vt100, send escape sequences for many special
key combinations. Entering the history search mode assigned a specific
meaning to the ESC character and disabled the processing of escape
sequences, thus accidentally printing some characters that are part
of a CSI.

As a workaround, avoid changing the meaning of ESC; users can still
use the well-known `ESC ESC` sequence (or any other editor command,
e.g. move left/right) to exit the history search mode.

This change only affects UNIX terminals.

Closes issue root-project#10209.
  • Loading branch information
jalopezg-git committed Mar 31, 2022
1 parent e111a85 commit 5682e73
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions core/textinput/src/textinput/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ namespace textinput {
// Stop incremental history search, leaving text at the
// history line currently selected.
if (fMode == kInputMode) return;
fContext->GetKeyBinding()->EnableEscCmd(false);
SetEditorPrompt(Text());
DisplayR.ExtendPromptUpdate(Range::kUpdateEditorPrompt);
fMode = kInputMode;
Expand Down Expand Up @@ -461,7 +460,6 @@ namespace textinput {
fSearch.clear();
fMode = (M == kCmdReverseSearch ? kHistRevSearchMode : kHistFwdSearchMode);
SetHistSearchModePrompt(R.fDisplay);
fContext->GetKeyBinding()->EnableEscCmd(true);
if (UpdateHistSearch(R)) return kPRSuccess;
return kPRError;
case kCmdHistReplay:
Expand Down

0 comments on commit 5682e73

Please sign in to comment.