From 15e83c4548b18194e1e707b31883e54d2fad1338 Mon Sep 17 00:00:00 2001 From: Siarzhuk Zharski Date: Fri, 15 Mar 2013 21:18:09 +0100 Subject: [PATCH] Omit Terminal Id title in case single app instance running Hide the current index of Terminal window from it's title if only ony instance of the Terminal application is running in the system. Fixes #9530. --- src/apps/terminal/TermWindow.cpp | 3 ++- src/apps/terminal/TitlePlaceholderMapper.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/terminal/TermWindow.cpp b/src/apps/terminal/TermWindow.cpp index 3703ec21ce..1e7987e888 100644 --- a/src/apps/terminal/TermWindow.cpp +++ b/src/apps/terminal/TermWindow.cpp @@ -1798,7 +1798,8 @@ TermWindow::_UpdateSessionTitle(int32 index) // evaluate the window title pattern WindowTitlePlaceholderMapper windowMapper(shellInfo, activeProcessInfo, - fTerminalRoster.ID() + 1, sessionTitle); + fTerminalRoster.CountTerminals() > 1 + ? fTerminalRoster.ID() + 1 : 0, sessionTitle); const BString& windowTitle = PatternEvaluator::Evaluate(fTitle.pattern, windowMapper); diff --git a/src/apps/terminal/TitlePlaceholderMapper.cpp b/src/apps/terminal/TitlePlaceholderMapper.cpp index b5ec9b4138..9cac1b51c8 100644 --- a/src/apps/terminal/TitlePlaceholderMapper.cpp +++ b/src/apps/terminal/TitlePlaceholderMapper.cpp @@ -90,7 +90,8 @@ WindowTitlePlaceholderMapper::MapPlaceholder(char placeholder, int64 number, case 'i': // window index _string.Truncate(0); - _string << fWindowIndex; + if (fWindowIndex != 0) + _string << fWindowIndex; return true; case 't':