Index: x11/konsole/files/patch-src_CMakeLists.txt =================================================================== --- x11/konsole/files/patch-src_CMakeLists.txt (nonexistent) +++ x11/konsole/files/patch-src_CMakeLists.txt (working copy) @@ -0,0 +1,14 @@ +--- src/CMakeLists.txt.orig 2014-11-01 04:17:02 UTC ++++ src/CMakeLists.txt +@@ -134,6 +134,11 @@ if(HAVE_LIBKONQ) + set(konsole_LIBS ${konsole_LIBS} ${LIBKONQ_LIBRARY}) + endif() + ++IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") ++ #procstat_getenvv() is in libprocstat ++ list(APPEND konsole_LIBS procstat) ++endif() ++ + ### Konsole Application + + kde4_add_ui_files(konsoleprivate_SRCS ColorSchemeEditor.ui Index: x11/konsole/files/patch-src_ProcessInfo.cpp =================================================================== --- x11/konsole/files/patch-src_ProcessInfo.cpp (nonexistent) +++ x11/konsole/files/patch-src_ProcessInfo.cpp (working copy) @@ -0,0 +1,118 @@ +--- src/ProcessInfo.cpp.orig 2014-11-01 04:17:02 UTC ++++ src/ProcessInfo.cpp +@@ -60,6 +60,9 @@ + #include + # if defined(Q_OS_FREEBSD) + # include ++# include ++# include ++# include + # endif + #endif + +@@ -280,10 +283,8 @@ void ProcessInfo::setUserName(const QStr + void ProcessInfo::setUserHomeDir() + { + const QString& usersName = userName(); +- if (!usersName.isEmpty()) +- _userHomeDir = KUser(usersName).homeDir(); +- else +- _userHomeDir = QDir::homePath(); ++ const QDir& homeDir(usersName.isEmpty() ? QDir::homePath() : KUser(usersName).homeDir()); ++ _userHomeDir = homeDir.canonicalPath(); + } + + void ProcessInfo::setParentPid(int aPid) +@@ -664,26 +665,60 @@ private: + + managementInfoBase[0] = CTL_KERN; + managementInfoBase[1] = KERN_PROC; +- managementInfoBase[2] = KERN_PROC_PID; ++ managementInfoBase[2] = KERN_PROC_ARGS; + managementInfoBase[3] = aPid; + + len = sizeof(args); + if (sysctl(managementInfoBase, 4, args, &len, NULL, 0) == -1) + return false; + +- const QStringList& argumentList = QString(args).split(QChar('\0')); ++ const QStringList& argumentList = QString::fromLocal8Bit(args, len).split(QChar('\0')); + +- for (QStringList::const_iterator it = argumentList.begin(); it != argumentList.end(); ++it) { +- addArgument(*it); ++ foreach (const QString& value, argumentList) { ++ if (!value.isEmpty()) ++ addArgument(value); + } + + return true; + } + + virtual bool readEnvironment(int aPid) { +- Q_UNUSED(aPid); +- // Not supported in FreeBSD? +- return false; ++ ++ struct procstat *prstat = procstat_open_sysctl(); ++ if (prstat == nullptr) { ++ return false; ++ } ++ ++ unsigned int cnt; ++ kinfo_proc *procinfo = procstat_getprocs(prstat, KERN_PROC_PID, aPid, &cnt); ++ if (procinfo == nullptr || cnt != 1) { ++ procstat_close(prstat); ++ return false; ++ } ++ ++ // pass 0, as the third argument, as we want to have every environment ++ // variable defined -- code courtesy of procstats procstats_arg.c ++ char **envs = procstat_getenvv(prstat, procinfo, 0); ++ if (envs == nullptr) { ++ procstat_close(prstat); ++ return false; ++ } ++ ++ for (int i = 0; envs[i] != nullptr; i++) { ++ const QString& entry = QString::fromLocal8Bit(envs[i]); ++ const int splitPos = entry.indexOf('='); ++ ++ if (splitPos != -1) { ++ const QString& name = entry.mid(0, splitPos); ++ const QString& value = entry.mid(splitPos + 1, -1); ++ ++ addEnvironmentBinding(name, value); ++ } ++ } ++ ++ procstat_freeenvv(prstat); ++ procstat_close(prstat); ++ return true; + } + + virtual bool readCurrentDir(int aPid) { +@@ -1105,8 +1140,8 @@ SSHProcessInfo::SSHProcessInfo(const Pro + _host = args[i]; + } + } else { +- // host has already been found, this must be the command argument +- _command = args[i]; ++ // host has already been found, this must be part of the command arguments ++ _command += (_command.isEmpty() ? "" : " ") + args[i]; + } + } + } else { +@@ -1151,6 +1186,13 @@ QString SSHProcessInfo::format(const QSt + // search for and replace known markers + output.replace("%u", _user); + ++ // provide 'user@' if user is defined -- this makes nicer ++ // remote tabs possible: "%U%h %c" => User@Host Command ++ // => Host Command ++ // Depending on whether -l was passed to ssh (which is mostly not the ++ // case due to ~/.ssh/config). ++ output.replace(QLatin1String("%U"),_user.isEmpty() ? QString() : _user+"@"); ++ + if (isIpAddress) + output.replace("%h", _host); + else