Commit 5c252472 authored by Tomaz  Canabrava's avatar Tomaz Canabrava Committed by Kurt Hindenburg
Browse files

React when ssh opens or closes.

parent 48202ef5
......@@ -152,7 +152,7 @@ void SSHManagerModel::setSessionController(Konsole::SessionController *controlle
void SSHManagerModel::triggerProfileChange(const QString &sshHost)
{
Q_UNUSED(sshHost);
qDebug() << "Localhost changed to" << sshHost;
}
void SSHManagerModel::load()
......
......@@ -1110,6 +1110,16 @@ QString Session::getDynamicTitle()
bool ok = false;
if (process->name(&ok) == QLatin1String("ssh") && ok) {
sshProcess = std::make_unique<SSHProcessInfo>(*process);
}
QString currHostName = sshProcess ? sshProcess->host() : process->localHost();
if (_currentHostName != currHostName) {
_currentHostName = currHostName;
Q_EMIT hostnameChanged(currHostName);
}
if (sshProcess) {
QString title = tabTitleFormat(Session::RemoteTabTitle);
title.replace(QLatin1String("%w"), userTitle());
title.replace(QLatin1String("%#"), QString::number(sessionId()));
......
......@@ -872,6 +872,8 @@ private:
static int lastSessionId;
bool _isPrimaryScreen;
QString _currentHostName;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment