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:
Michael Zuercher
2002-04-23 21:24:18 +00:00
parent 29329c7c9c
commit ccc91e5fdf
3 changed files with 23 additions and 1 deletions

View File

@@ -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

View File

@@ -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; }

View File

@@ -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&);