Comparing version 2.1.0 to 2.1.1
@@ -0,1 +1,5 @@ | ||
### Version 2.1.1 (2020-09-10) | ||
Fixed: The first line of output and keyboard shortcuts now show up as they should on Windows ([#3](https://github.com/lydell/run-pty/issues/3)). | ||
### Version 2.1.0 (2020-08-06) | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "run-pty", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"author": "Simon Lydell", | ||
@@ -31,13 +31,13 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/jest": "26.0.8", | ||
"@typescript-eslint/eslint-plugin": "3.8.0", | ||
"@typescript-eslint/parser": "3.8.0", | ||
"eslint": "7.6.0", | ||
"eslint-plugin-jest": "23.20.0", | ||
"jest": "26.2.2", | ||
"prettier": "2.0.5", | ||
"typescript": "3.9.7" | ||
"@types/jest": "26.0.13", | ||
"@typescript-eslint/eslint-plugin": "4.1.0", | ||
"@typescript-eslint/parser": "4.1.0", | ||
"eslint": "7.8.1", | ||
"eslint-plugin-jest": "24.0.0", | ||
"jest": "26.4.2", | ||
"prettier": "2.1.1", | ||
"typescript": "4.0.2" | ||
}, | ||
"scripts": { | ||
"start": "node run-pty.js % cat % false % echo hello world % ping localhost % node test-keys.js % node signals.js % node slow-kill.js % node slow-kill.js 2000 \"Shutting down…\" % make watch", | ||
"start": "node run-pty.js % cat % false % echo hello world % ping localhost % node get-cursor-position.js % node test-keys.js % node signals.js % node slow-kill.js % node slow-kill.js 2000 \"Shutting down…\" % make watch", | ||
"test": "prettier --check . && eslint . && tsc && jest", | ||
@@ -44,0 +44,0 @@ "prepublishOnly": "npm test" |
@@ -55,3 +55,3 @@ #!/usr/bin/env node | ||
const DISABLE_BRACKETED_PASTE_MODE = "\x1B[?2004l"; | ||
const RESET_COLOR = "\x1B[0m"; | ||
const RESET_COLOR = "\x1B[m"; | ||
const CLEAR = IS_WINDOWS ? "\x1B[2J\x1B[0f" : "\x1B[2J\x1B[3J\x1B[H"; | ||
@@ -288,3 +288,3 @@ | ||
// eslint-disable-next-line no-control-regex | ||
string.replace(/\x1B\[\d+m/g, ""); | ||
string.replace(/\x1B\[\d*m/g, ""); | ||
@@ -468,4 +468,12 @@ /** | ||
rows: process.stdout.rows, | ||
// Avoid conpty adding escape sequences to clear the screen: | ||
conptyInheritCursor: true, | ||
}); | ||
if (IS_WINDOWS) { | ||
// Needed when using `conptyInheritCursor`. Otherwise the spawned | ||
// terminals hang and will not run their command. | ||
terminal.write("\x1B[1;1R"); | ||
} | ||
const disposeOnData = terminal.onData((data) => { | ||
@@ -563,3 +571,6 @@ this.pushHistory(data); | ||
case "Running": | ||
if (command.history.endsWith("\n")) { | ||
if ( | ||
command.history.endsWith("\n") || | ||
command.history.endsWith(`\n${RESET_COLOR}`) | ||
) { | ||
process.stdout.write(RESET_COLOR + runningText); | ||
@@ -566,0 +577,0 @@ } |
29067
779