forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When TERM=dumb and .isTTY=true don't use ANSI escape codes and ignore all keys, except 'escape', 'return' and 'ctrl-c'. Fixes: nodejs#26187
- Loading branch information
1 parent
1c0ba10
commit 1b7434d
Showing
3 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
require('../common'); | ||
|
||
process.env.TERM = 'dumb'; | ||
|
||
const readline = require('readline'); | ||
|
||
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
|
||
rl.write('text'); | ||
rl.write(null, { ctrl: true, name: 'u' }); | ||
rl.write(null, { name: 'return' }); | ||
rl.write('text'); | ||
rl.write(null, { name: 'backspace' }); | ||
rl.write(null, { name: 'escape' }); | ||
rl.write(null, { name: 'enter' }); | ||
rl.write('text'); | ||
rl.write(null, { ctrl: true, name: 'c' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
text | ||
text | ||
text |