React when ssh opens or closes.

wilder
Tomaz Canabrava 4 years ago committed by Kurt Hindenburg
parent 48202ef5bd
commit 5c252472f8
  1. 2
      src/plugins/SSHManager/sshmanagermodel.cpp
  2. 10
      src/session/Session.cpp
  3. 2
      src/session/Session.h

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

Loading…
Cancel
Save