From 36bd1828f373a1a04b8f9d740ca014722ca0597a Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Tue, 29 Nov 2011 13:49:12 +0800 Subject: [PATCH] Revert "Ensure %w and %# are also expaned in the 'Copy input' dialog" That fix is not good enough because it makes '%w' being updated only after keystroke instead of immediately . The issue of updating title is actually a little more complicated than I have understood. Revert it because the regression should influence more users than the fixed problem does. Need to spend more time to find a better fix. CCBUG: 175755 CCBUG: 287536 This reverts commit 1c1981501b6e3bcd433840bf36f7851f06772322. --- src/Session.cpp | 8 -------- src/SessionController.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Session.cpp b/src/Session.cpp index e73109fb..67b34083 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -1010,14 +1010,6 @@ QString Session::getDynamicTitle() title = process->format(tabTitleFormat(Session::LocalTabTitle)); } - // special handling for the "%w" marker which is replaced with the - // window title set by the terminal process(shell,mc,vim,etc) - title.replace("%w", userTitle()); - - // special handling for the "%#" marker which is replaced with the - // number of the session - title.replace("%#", QString::number(sessionId())); - return title; } diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 291fe44d..0be41a0a 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -1122,6 +1122,14 @@ void SessionController::sessionTitleChanged() } QString title = _session->title(Session::DisplayedTitleRole); + + // special handling for the "%w" marker which is replaced with the + // window title set by the shell + title.replace("%w",_session->userTitle()); + // special handling for the "%#" marker which is replaced with the + // number of the shell + title.replace("%#",QString::number(_session->sessionId())); + if ( title.isEmpty() ) title = _session->title(Session::NameRole);