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.
This commit is contained in:
Siarzhuk Zharski 2013-03-15 21:18:09 +01:00
parent ef60154123
commit 15e83c4548
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -90,6 +90,7 @@ WindowTitlePlaceholderMapper::MapPlaceholder(char placeholder, int64 number,
case 'i':
// window index
_string.Truncate(0);
if (fWindowIndex != 0)
_string << fWindowIndex;
return true;