From 112baec8d098c5c28e94a182c4e83f71f08b1284 Mon Sep 17 00:00:00 2001 From: Marc Bachmann Date: Mon, 18 Jul 2016 04:52:29 +0200 Subject: [PATCH] Make CMD + K work for all commands, even tail (#215) --- app/lib/components/term.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/lib/components/term.js b/app/lib/components/term.js index 1c5f0b7c..df10b424 100644 --- a/app/lib/components/term.js +++ b/app/lib/components/term.js @@ -87,6 +87,13 @@ export default class Term extends Component { clear () { this.term.clearPreserveCursorRow(); + + // If cursor is still not at the top, a command is probably + // running and we'd like to delete the whole screen. + // Move cursor to top + if (this.term.getCursorRow() !== 0) { + this.term.io.writeUTF8('\x1B[0;0H\x1B[2J'); + } } getTermDocument () {