From 0dd49584e26c294e3fb25347969f61bca84afb5f Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 29 Aug 2015 22:12:49 +0200 Subject: Automatically destroy terminal when killed and display history Child processes of _MetaTerm_ may be terminated using other ways that the integrated kill command. Automatic terminal widget destruction in such a event prevents the user from viewing the output of non-interactive applications. This requires _MetaTerm_ to display the application's output after it was terminated. This requirement is implemented via the new `HistoryViewer` widget that is instantiated after the terminal widget instance has been destroyed. --- src/widget/EmbeddedTerminal.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/widget/EmbeddedTerminal.qml') diff --git a/src/widget/EmbeddedTerminal.qml b/src/widget/EmbeddedTerminal.qml index fa30e23..497bf49 100644 --- a/src/widget/EmbeddedTerminal.qml +++ b/src/widget/EmbeddedTerminal.qml @@ -5,11 +5,15 @@ import QtQuick.Layouts 1.1 Item { id: item + signal finished + property string program property string workingDirectory property int lines : settings.terminal.initialLines + property alias history : session.history + function select() { highlighter.select() } function deselect() { highlighter.deselect() } function displayOverlay() { overlay.displayBriefly() } @@ -48,6 +52,8 @@ Item { colorScheme: settings.terminal.colorScheme session: QMLTermSession { + id: session + initialWorkingDirectory: item.workingDirectory shellProgram: { @@ -60,6 +66,11 @@ Item { return elements; } + + onFinished: { + clearScreen(); + item.finished(); + } } Component.onCompleted: { -- cgit v1.2.3