aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.js4
-rw-r--r--src/list/TerminalItem.qml13
-rw-r--r--src/widget/EmbeddedTerminal.qml2
3 files changed, 17 insertions, 2 deletions
diff --git a/src/command/commands.js b/src/command/commands.js
index 333eb98..07a1f04 100644
--- a/src/command/commands.js
+++ b/src/command/commands.js
@@ -94,7 +94,9 @@ function jump(output, index) {
}
function kill(output, index) {
- terminalList.get(index).reset();
+ if ( !terminalList.get(index).terminate() ) {
+ output.error("Failed to terminate process.");
+ }
}
function next() {
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();
diff --git a/src/widget/EmbeddedTerminal.qml b/src/widget/EmbeddedTerminal.qml
index 192fcef..4d48f92 100644
--- a/src/widget/EmbeddedTerminal.qml
+++ b/src/widget/EmbeddedTerminal.qml
@@ -18,6 +18,8 @@ Item {
function deselect() { highlighter.deselect() }
function displayOverlay() { overlay.displayBriefly() }
+ function terminate() { return session.sendSignal(15) }
+
height: terminal.height
width: parent.width - settings.terminal.frameWidth