Bug 154295 - Allow %u in tabs
Summary: Allow %u in tabs
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-19 02:10 UTC by Mike
Modified: 2009-04-12 03:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Allow %u in tabs (4.12 KB, patch)
2009-03-08 23:15 UTC, Kurt Hindenburg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2007-12-19 02:10:41 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

When changing to different users on a local session with su the tab title does not change to the new username.

ie
olduser@localhost $ su newuser
Password :
olduser@localhost $ whoami
newuser
olduser@localhost $ echo $USER
newuser

But the tab title still says olduser : bash
Comment 1 FiNeX 2007-12-19 10:55:14 UTC
The default title has the "%d" which show the current directory (without full path), not the current user.

Anyway, while the current user on the shell is different from the owner of the konqueror istance, the tab title is never updated.

Moreover, titles are not updated immediatly.

Comment 2 Robert Knight 2007-12-20 02:48:02 UTC
> Moreover, titles are not updated immediatly. 

A title update occurs about two seconds after user input.  Title updates do not happen unless there is user input to the terminal.  There are several reasons for this:

- Performance: To avoid waking Konsole up continually to poll the terminal state
- Avoid flicker: Prevent the tab title from flickering when running a script or other activity which starts lots of processes to accomplish its task
- Relevance:  When a long-running command finishes, the name of the tab title would go back to "currentdir : bash" or similar, which is less useful than "currentdir : name-of-last-task-you-started"

> Anyway, while the current user on the shell is different from the
> owner of the konqueror istance, the tab title is never updated. 

Probably a permissions issue.  If for some reason Konsole does not have permission to read information about the foreground process it climbs up the process hierarchy until it finds a process whoose permissions it can read and then uses that.
Comment 3 FiNeX 2007-12-20 11:49:47 UTC
> A title update occurs about two seconds after user input.
> Title updates do not happen unless there is user input to the terminal.
> There are several reasons for this

Yes, I understand.

> Probably a permissions issue
> [...]

In effect this have sense... 

What should be done? Is this a "WONTFIX" by design?
Comment 4 Anne Wilson 2008-05-25 18:21:27 UTC
v.4.0.4 - specifically I want the user to show the current user, especially if it is root.  I can't find any way to make this happen.
Comment 5 Kurt Hindenburg 2009-03-08 23:15:20 UTC
Created attachment 31921 [details]
Allow %u in tabs

Here's a first attempt at this.  It works for me on Linux/Kubuntu;  Kubuntu doesn't have root so I couldn't test that but other 'su - account' worked.

Please test this if you have trunk installed.  This likely only works on Linux.

I wonder if any of this could be cached; reading /etc/pid/status and getpwuid might be a bit much.
Comment 6 Kurt Hindenburg 2009-04-12 02:52:42 UTC
SVN commit 952487 by hindenburg:

Allow %u (user) in tab/window title

BUG: 154295


 M  +65 -1     ProcessInfo.cpp  
 M  +19 -1     ProcessInfo.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=952487
Comment 7 Kurt Hindenburg 2009-04-12 03:01:25 UTC
SVN commit 952488 by hindenburg:

Allow user to select 'User Name' from drop down.

CCBUG: 154295


 M  +3 -2      TabTitleFormatAction.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=952488