Skip to content

new-installer: Support showing progress in terminal title#52465

Open
michaelkuhn wants to merge 1 commit into
spack:developfrom
michaelkuhn:new-installer-term-title
Open

new-installer: Support showing progress in terminal title#52465
michaelkuhn wants to merge 1 commit into
spack:developfrom
michaelkuhn:new-installer-term-title

Conversation

@michaelkuhn
Copy link
Copy Markdown
Member

The new installer has nice inline progress reporting, but when switching away from a tab, there is currently no way to keep track of progress. This adds support for showing progress in the terminal title, similar to the old installer.

spack-new-installer-term-title

@michaelkuhn michaelkuhn force-pushed the new-installer-term-title branch from f8bf151 to 5b920e2 Compare May 29, 2026 21:30
Comment thread lib/spack/spack/new_installer.py Outdated
@haampie
Copy link
Copy Markdown
Member

haampie commented May 30, 2026

Should the terminal title also update when it's finished? Currently it seems to be in the "in progress" branch only.

@michaelkuhn michaelkuhn force-pushed the new-installer-term-title branch from 5b920e2 to 7006f44 Compare May 30, 2026 22:24
@michaelkuhn
Copy link
Copy Markdown
Member Author

Should the terminal title also update when it's finished? Currently it seems to be in the "in progress" branch only.

I could add a separate title for this, but I guess it would only show "Spack: Done! ✨" for a split second before the terminal title is overwritten by the shell anyway.

@haampie
Copy link
Copy Markdown
Member

haampie commented May 31, 2026

Screenshot 2026-05-31 at 08 28 10

On macOS it looks like this after it's finished

@michaelkuhn michaelkuhn force-pushed the new-installer-term-title branch from 7006f44 to 9903971 Compare May 31, 2026 08:41
@michaelkuhn
Copy link
Copy Markdown
Member Author

On macOS it looks like this after it's finished

Ah, looks like macOS does not set a terminal title then. I added some code to explicitly clear the title after we're finished and pushed an update. Let me know if that works for you.

@michaelkuhn michaelkuhn force-pushed the new-installer-term-title branch from 9903971 to 296e606 Compare May 31, 2026 08:42
@haampie
Copy link
Copy Markdown
Member

haampie commented May 31, 2026

OK, I think this needs a little bit of improvement still.

The update function is called every iteration of the event loop (every 100ms or less) and buffers the full string so it just does a single write syscall. The terminal title change looks a bit odd there cause it doesn't use the buffer, and it is constant/redundant for the vast majority of update calls.

I think it's more natural if it goes in update_state. That way it could also run when following logs.

The new installer has nice inline progress reporting, but when switching
away from a tab, there is currently no way to keep track of progress.
This adds support for showing progress in the terminal title, similar to
the old installer.

Signed-off-by: Michael Kuhn <michael.kuhn@ovgu.de>
@michaelkuhn michaelkuhn force-pushed the new-installer-term-title branch from 296e606 to 0b1b260 Compare May 31, 2026 15:49
@michaelkuhn
Copy link
Copy Markdown
Member Author

I think it's more natural if it goes in update_state. That way it could also run when following logs.

Got it, I've pushed a new version. We now update the terminal title in three places: When changing the number of jobs, when updating the state and when finalizing (to clear it).

@michaelkuhn
Copy link
Copy Markdown
Member Author

@haampie Ping? 🙂

@haampie haampie added this to the v1.2.0 milestone Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants