From 51e69178618944d3454e76b0a7de747435be57a0 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 13 Aug 2015 21:01:54 +0200 Subject: Implement `kill` command --- qml/StateHandler.qml | 5 ++++- qml/TerminalItem.qml | 1 - qml/TerminalList.qml | 4 ++++ qml/commands.js | 6 ++++-- 4 files changed, 12 insertions(+), 4 deletions(-) (limited to 'qml') diff --git a/qml/StateHandler.qml b/qml/StateHandler.qml index 04215df..d9f5f5a 100644 --- a/qml/StateHandler.qml +++ b/qml/StateHandler.qml @@ -150,6 +150,9 @@ Item { Action { id: resetTerminalAction shortcut: settings.resetItem - onTriggered: terminalList.getCurrent().reset() + onTriggered: { + terminalList.getCurrent().reset(); + terminalList.getCurrent().select(); + } } } diff --git a/qml/TerminalItem.qml b/qml/TerminalItem.qml index fc7bbf7..57197bd 100644 --- a/qml/TerminalItem.qml +++ b/qml/TerminalItem.qml @@ -84,7 +84,6 @@ Item { command.focus = true; unfocus(); - select(); } } diff --git a/qml/TerminalList.qml b/qml/TerminalList.qml index 013b394..6c6465b 100644 --- a/qml/TerminalList.qml +++ b/qml/TerminalList.qml @@ -89,6 +89,10 @@ Item { return children[activeItem]; } + function get(index) { + return children[index]; + } + function iterate(func) { for ( var i = 0; i < children.length; i++ ) { func(children[i]); diff --git a/qml/commands.js b/qml/commands.js index 7069458..23f0a7f 100644 --- a/qml/commands.js +++ b/qml/commands.js @@ -23,8 +23,6 @@ function exec(output, args) { if ( typeof result !== 'undefined' ) { output.log(result); - } else { - output.log(''); } } @@ -32,6 +30,10 @@ function jump(output, index) { terminalList.selectItem(index); } +function kill(output, index) { + terminalList.get(index).reset(); +} + function next() { terminalList.selectNext(); } -- cgit v1.2.3