From 52dd097c4d679d53060b415e065151806f0acfbf Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 4 Sep 2015 22:05:46 +0200 Subject: Reimplemented `kill` command using actual signal sending Previously `kill` merely destroyed the terminal widget. This is contrary to the expected notion of `kill`, i.e. actually killing the process explicitly instead of relying on side effects. The normal mode `d` verb now explicitly destroys the current item's content, be it a terminal widget or a history view. --- src/list/TerminalItem.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/list') diff --git a/src/list/TerminalItem.qml b/src/list/TerminalItem.qml index 7dd0350..2eb9dc7 100644 --- a/src/list/TerminalItem.qml +++ b/src/list/TerminalItem.qml @@ -81,6 +81,14 @@ Item { unfocus(); } + function terminate() { + if ( terminal !== null ) { + terminal.terminate(); + } else { + throw "No process to terminate."; + } + } + FocusScope { id: scope @@ -114,7 +122,10 @@ Item { item.terminal.onFinished.connect(function() { createHistoryViewer(item.terminal.history); item.reset(); - item.select(); + + if ( item.index === terminalList.activeItem ) { + item.select(); + } if ( item.index === ( terminalList.children.length - 2 ) ) { terminalList.selectNext(); -- cgit v1.2.3