Modifying $PS1 on startup in Ubuntu WSL breaks tab title #6182

Closed
opened 2026-01-31 00:31:48 +00:00 by claunia · 2 comments
Owner

Originally created by @ransagy on GitHub (Jan 28, 2020).

Environment

Windows build number: 10.0.18363.535
Windows Terminal version (if applicable): 0.8.10261.0
Ubuntu WSL 18.04 LTS (installed cleanly from Store)

Steps to reproduce

  1. Open Ubuntu WSL.
  2. Edit the ~/.bashrc file with nano.
  3. At the last line, Add a non-default prompt template/format e.g. PS1='$PWD > '
  4. Save, Exit nano and restart the terminal.

Expected behavior

Terminal mirrors the prompt/title set by the shell, e.g. /home/myuser >

Actual behavior

Title is set to Ubuntu and never changes.

Note

I got here by trying to use https://github.com/magicmonty/bash-git-prompt but it seems every change to the prompt triggers this for me. I unregistered/uninstalled Ubuntu and deleted my Terminal's profiles.json, reinstalled and tried again and i get the same behavior. Curiously, I have the same set up on a CentOS WSL install (not an official store one though) and the expected behavior does happen there.

Originally created by @ransagy on GitHub (Jan 28, 2020). # Environment ```none Windows build number: 10.0.18363.535 Windows Terminal version (if applicable): 0.8.10261.0 Ubuntu WSL 18.04 LTS (installed cleanly from Store) ``` # Steps to reproduce 1. Open Ubuntu WSL. 2. Edit the ~/.bashrc file with nano. 3. At the last line, Add a non-default prompt template/format e.g. `PS1='$PWD > '` 4. Save, Exit nano and restart the terminal. # Expected behavior Terminal mirrors the prompt/title set by the shell, e.g. `/home/myuser > ` # Actual behavior Title is set to `Ubuntu` and never changes. # Note I got here by trying to use https://github.com/magicmonty/bash-git-prompt but it seems every change to the prompt triggers this for me. I unregistered/uninstalled Ubuntu and deleted my Terminal's profiles.json, reinstalled and tried again and i get the same behavior. Curiously, I have the same set up on a CentOS WSL install (not an official store one though) and the expected behavior does happen there.
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-31 00:31:49 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 28, 2020):

Some bash configurations—the one that ships with Ubuntu, for example—actually use part of PS1 to set the window title.

There’s an escape sequence embedded in PS1 that sets the window title which is being overwritten when you reset PS1.

@DHowett-MSFT commented on GitHub (Jan 28, 2020): Some bash configurations—the one that ships with Ubuntu, for example—actually use part of `PS1` to set the window title. There’s an escape sequence embedded in `PS1` that sets the window title which is being overwritten when you reset `PS1`.
Author
Owner

@ransagy commented on GitHub (Jan 28, 2020):

Ah. I figured as much but wasn't sure. Thanks and sorry for the noise :)

@ransagy commented on GitHub (Jan 28, 2020): Ah. I figured as much but wasn't sure. Thanks and sorry for the noise :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6182