diff options
-rw-r--r-- | qml/CommandInput.qml | 6 | ||||
-rw-r--r-- | qml/TerminalList.qml | 6 | ||||
-rw-r--r-- | qml/commands.js | 7 |
3 files changed, 18 insertions, 1 deletions
diff --git a/qml/CommandInput.qml b/qml/CommandInput.qml index 5fbde77..99f5d0e 100644 --- a/qml/CommandInput.qml +++ b/qml/CommandInput.qml @@ -118,7 +118,11 @@ Item { } function log(msg) { - text += msg; + if ( isInitial() ) { + text = msg; + } else { + text += '<br/>' + msg; + } } function error(msg) { diff --git a/qml/TerminalList.qml b/qml/TerminalList.qml index fe89be5..013b394 100644 --- a/qml/TerminalList.qml +++ b/qml/TerminalList.qml @@ -89,6 +89,12 @@ Item { return children[activeItem]; } + function iterate(func) { + for ( var i = 0; i < children.length; i++ ) { + func(children[i]); + } + } + Flickable { id: flickable diff --git a/qml/commands.js b/qml/commands.js index 765a747..7069458 100644 --- a/qml/commands.js +++ b/qml/commands.js @@ -40,3 +40,10 @@ function prev() { terminalList.selectPrev(); } +function ls(output) { + terminalList.iterate(function(item) { + if ( item.terminal !== null ) { + output.log(item.index + ': ' + item.terminal.program); + } + }); +} |