Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: re-enable dumb tty
  • Loading branch information
ronag committed Jul 2, 2021
commit 8259042341e93a3bb3f751c13b71269c0c27481d
62 changes: 29 additions & 33 deletions test/pseudo-tty/repl-dumb-tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,37 @@
const common = require('../common');
const process = require('process');

// TODO (fix): So this work on darwin/linux?
if (process.env === 'windows') {
process.env.TERM = 'dumb';
process.env.TERM = 'dumb';

const repl = require('repl');
const ArrayStream = require('../common/arraystream');
const repl = require('repl');
const ArrayStream = require('../common/arraystream');

repl.start('> ');
repl.start('> ');

// Verify <ctrl> + D support.
{
const stream = new ArrayStream();
const replServer = new repl.REPLServer({
prompt: '> ',
terminal: true,
input: stream,
output: process.stdout,
useColors: false
});

replServer.on('close', common.mustCall());
// Verify that <ctrl> + R or <ctrl> + C does not trigger the reverse search.
replServer.write(null, { ctrl: true, name: 'r' });
replServer.write(null, { ctrl: true, name: 's' });
replServer.write(null, { ctrl: true, name: 'd' });
}

process.stdin.push('conso'); // No completion preview.
process.stdin.push('le.log("foo")\n');
process.stdin.push('1 + 2'); // No input preview.
process.stdin.push('\n');
process.stdin.push('"str"\n');
process.stdin.push('console.dir({ a: 1 })\n');
process.stdin.push('{ a: 1 }\n');
process.stdin.push('\n');
process.stdin.push('.exit\n');
// Verify <ctrl> + D support.
{
const stream = new ArrayStream();
const replServer = new repl.REPLServer({
prompt: '> ',
terminal: true,
input: stream,
output: process.stdout,
useColors: false
});

replServer.on('close', common.mustCall());
// Verify that <ctrl> + R or <ctrl> + C does not trigger the reverse search.
replServer.write(null, { ctrl: true, name: 'r' });
replServer.write(null, { ctrl: true, name: 's' });
replServer.write(null, { ctrl: true, name: 'd' });
}

process.stdin.push('conso'); // No completion preview.
process.stdin.push('le.log("foo")\n');
process.stdin.push('1 + 2'); // No input preview.
process.stdin.push('\n');
process.stdin.push('"str"\n');
process.stdin.push('console.dir({ a: 1 })\n');
process.stdin.push('{ a: 1 }\n');
process.stdin.push('\n');
process.stdin.push('.exit\n');