shorten tab text #5409

Closed
opened 2026-01-31 00:12:43 +00:00 by claunia · 4 comments
Owner

Originally created by @hteibler on GitHub (Dec 5, 2019).

Description of the new feature/enhancement

shorten tab text
if you have a very long path, one tab can consume nearly the whole window size space
or many tabs with long path, us

Proposed technical implementation details (optional)

ability to configure tab, like the prompt
eg, only last 2 layers of directory
eg. user without hostname
eg. only path
eg. ...

Originally created by @hteibler on GitHub (Dec 5, 2019). # Description of the new feature/enhancement shorten tab text if you have a very long path, one tab can consume nearly the whole window size space or many tabs with long path, us # Proposed technical implementation details (optional) ability to configure tab, like the prompt eg, only last 2 layers of directory eg. user without hostname eg. only path eg. ...
Author
Owner

@zadjii-msft commented on GitHub (Dec 5, 2019):

You can already override the starting title of the window with the tabTitle parameter.

Most shells let you change the title at runtime - see #2304 for details. cmd lets you change the title with the title command, and I know that bash by default sets the title using the PS1 variable.

If you're looking for more dynamic text in the tab, there's also #1320.

There's also #597 for adding settings to manually control the width of the tab.

@hteibler Would you say that any of the above issues have an appropriate solution to your problem?

@zadjii-msft commented on GitHub (Dec 5, 2019): You can already override the starting title of the window with the `tabTitle` parameter. Most shells let you change the title at runtime - see #2304 for details. `cmd` lets you change the title with the `title` command, and I know that `bash` by default sets the title using the `PS1` variable. If you're looking for more dynamic text in the tab, there's also #1320. There's also #597 for adding settings to manually control the width of the tab. @hteibler Would you say that any of the above issues have an appropriate solution to your problem?
Author
Owner

@hteibler commented on GitHub (Dec 6, 2019):

I think I don't get it ...
in CMD title is working
but no clue with ubuntu
and "tabTitle" in json profile is ignored, --> should overrule

@hteibler commented on GitHub (Dec 6, 2019): I think I don't get it ... in CMD title is working but no clue with ubuntu and "tabTitle" in json profile is ignored, --> should overrule
Author
Owner

@hteibler commented on GitHub (Dec 6, 2019):

found a solution for me: don't display user@host for my default user in title
in .bashrc ( of default user) I removed \u@\h from here:
old:
PS1="[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a]$PS1"
new:
case "$TERM" in
xterm*|rxvt*)
PS1="[\e]0;${debian_chroot:+($debian_chroot)}\w\a]$PS1"
;;
*)
;;
esac

@hteibler commented on GitHub (Dec 6, 2019): found a solution for me: don't display user@host for my default user in title in .bashrc ( of default user) I removed \u@\h from here: old: PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" new: case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\w\a\]$PS1" ;; *) ;; esac
Author
Owner

@zadjii-msft commented on GitHub (Dec 6, 2019):

tabTitle is more correctly "starting title" - it's just the title that the shell starts with. As you've discovered, bash resets the title on each prompt. There's another setting we've added, suppressApplicationTitle that should prevent bash from setting the title at all, though it's a little buggy in 0.7.

Since you've seemed to found a solution that works for you, I'm going to close this thread. Thanks!

@zadjii-msft commented on GitHub (Dec 6, 2019): `tabTitle` is more correctly "starting title" - it's just the title that the shell starts with. As you've discovered, `bash` resets the title on each prompt. There's another setting we've added, `suppressApplicationTitle` that should prevent `bash` from setting the title at all, though it's a little buggy in 0.7. Since you've seemed to found a solution that works for you, I'm going to close this thread. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5409