aboutsummaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
authorAdrian Kummerlaender2015-12-12 23:37:11 +0100
committerAdrian Kummerlaender2015-12-12 23:37:11 +0100
commitd1200ca432038a34a9fa063244136e737ce47735 (patch)
treed687b0fda491b2bac38defb8f42b96e6b08f459b /src/command
parente3f7344551a387653c2271ecc24d95051a04a2d1 (diff)
downloadMetaTerm-d1200ca432038a34a9fa063244136e737ce47735.tar
MetaTerm-d1200ca432038a34a9fa063244136e737ce47735.tar.gz
MetaTerm-d1200ca432038a34a9fa063244136e737ce47735.tar.bz2
MetaTerm-d1200ca432038a34a9fa063244136e737ce47735.tar.lz
MetaTerm-d1200ca432038a34a9fa063244136e737ce47735.tar.xz
MetaTerm-d1200ca432038a34a9fa063244136e737ce47735.tar.zst
MetaTerm-d1200ca432038a34a9fa063244136e737ce47735.zip
Expose session PID and current working directory
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/command/commands.js b/src/command/commands.js
index 2ec1bb6..13bb1c2 100644
--- a/src/command/commands.js
+++ b/src/command/commands.js
@@ -115,12 +115,12 @@ function q() {
Qt.quit();
}
-function cd(output, path) {
- if ( path.length > 0 ) {
- if ( !workingDirectory.cd(path) ) {
- output.error('\"' + path + '\" doesn\'t exist.');
- }
+function pwd(output) {
+ var terminal = terminalList.getCurrent().terminal;
+
+ if ( terminal !== null ) {
+ output.log(cwd.currentOfPID(terminal.getPID()));
} else {
- output.log(workingDirectory.current());
+ output.error('No running session selected.');
}
}