Skip to content

Window title does not refresh after cd until tab focus changes #1002

@lobre

Description

@lobre

What Happened?

When I change directory in a tab (for example, cd /tmp), the tab label updates, but the window title still shows the old directory.

The window title only refreshes after another UI event, like switching to another tab and coming back.

From what we discussed, it seems related to the split between:

  • CWD tracking is used for tab label updates, and
  • VTE window-title-changed updates used for the window title.

From a quick code read, cwd_changed updates tab labels but does not directly call set_title() in MainWindow (src/MainWindow.vala:773), while tab switches do call set_title() (src/MainWindow.vala:293), which matches the behavior above.

Related context: originally discussed in #992, but opening this separate issue as requested.

Please check the following comment on that other issue, on which there is a screencast where we see the problem.

#992 (comment)

Steps to Reproduce

  1. Open elementary Terminal.
  2. In a tab, note the current window title path.
  3. Run cd /tmp (or any other directory).
  4. Observe that the tab label updates, but the window title does not.
  5. Switch to another tab and back.
  6. Observe that the window title now updates to the correct directory.

Expected Behavior

The window title should update immediately when the shell working directory changes (same moment the tab label updates), without needing a tab switch or other manual refresh.

OS Version

8.x (Circe)

OS Architecture

amd64 (on most hardwares)

Session Type

Secure Session (Wayland, This is the default)

Software Version

Latest release (I have run all updates)

Log Output

Hardware Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions