Expose current session dir (#15)

* expose the current working directory

* test current dir interface

Co-authored-by: rbn42 <bl100@students.waikato.ac.nz>
This commit is contained in:
rbn42
2020-05-06 22:31:18 +08:00
committed by GitHub
parent e1b6ac5c6c
commit 8fa2366ed9
5 changed files with 35 additions and 0 deletions
+12
View File
@@ -943,6 +943,18 @@ QString Session::foregroundProcessName()
return name;
}
QString Session::currentDir()
{
QString path;
if (updateForegroundProcessInfo()) {
bool ok = false;
path= _foregroundProcessInfo->currentDir(&ok);
if (!ok)
path.clear();
}
return path;
}
bool Session::updateForegroundProcessInfo()
{
Q_ASSERT(_shellProcess);