mirror of
https://github.com/KDE/konsole.git
synced 2026-05-06 21:53:55 -04:00
Make konsole restore cwd when restoring session. Only works on linux at this point.
svn path=/trunk/kdebase/konsole/; revision=151535
This commit is contained in:
@@ -23,3 +23,15 @@ if test "$ac_use_openpty" = "yes"; then
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
dnl Set preprocessor variable of how to get cwd from a process
|
||||
AC_MSG_CHECKING(how cwd can be be found by seperate process)
|
||||
case "$host" in
|
||||
*-*-linux*) cwd_method='proc' ;;
|
||||
*) cwd_method='no' ;;
|
||||
esac
|
||||
AC_MSG_RESULT($cwd_method)
|
||||
|
||||
case "$cwd_method" in
|
||||
proc) AC_DEFINE(HAVE_PROC_CWD, 1, [Defines whether /proc/`pid`/cwd exists]) ;;
|
||||
esac
|
||||
|
||||
@@ -317,6 +317,16 @@ QString TESession::getPgm()
|
||||
return pgm;
|
||||
}
|
||||
|
||||
QString TESession::getCwd()
|
||||
{
|
||||
#ifdef HAVE_PROC_CWD
|
||||
QFileInfo Cwd(QString("/proc/%1/cwd").arg(sh->pid()));
|
||||
if(Cwd.isSymLink())
|
||||
cwd = Cwd.readLink();
|
||||
#endif /* HAVE_PROC_CWD */
|
||||
return cwd;
|
||||
}
|
||||
|
||||
bool TESession::isMonitorActivity() { return monitorActivity; }
|
||||
bool TESession::isMonitorSilence() { return monitorSilence; }
|
||||
bool TESession::isMasterMode() { return masterMode; }
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
QString keymap();
|
||||
QStrList getArgs();
|
||||
QString getPgm();
|
||||
QString getCwd() { return cwd; }
|
||||
QString getCwd();
|
||||
QString getInitial_cwd() { return initial_cwd; }
|
||||
|
||||
void setHistory(const HistoryType&);
|
||||
|
||||
Reference in New Issue
Block a user