[PR #5775] [MERGED] Enable tab renaming at runtime from the UI #26465

Open
opened 2026-01-31 09:16:16 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5775
Author: @zadjii-msft
Created: 5/6/2020
Status: ✅ Merged
Merged: 5/28/2020
Merged by: @undefined

Base: master ← Head: dev/migrie/f/1079-rename-tab


📝 Commits (10+)

  • 19ab0ee This looks alright, but it's a horrible hack
  • 742282a Some minor cleanup of the previous commit
  • a0e36e9 accidentally the whole thing
  • 24f11eb Cleanup for review
  • bf4c421 Update src/cascadia/TerminalApp/Tab.cpp
  • 466e926 Merge remote-tracking branch 'origin/master' into dev/migrie/f/1079-rename-tab
  • 28ba1eb when the tab is renamed, bubble the value up to the window title
  • 8a682d8 Don't reset the text box when the title changes underneath us
  • b47f43a get rid of this outstanding todo
  • cab6c22 good bot

📊 Changes

4 files changed (+193 additions, -26 deletions)

View changed files

📝 src/cascadia/TerminalApp/Resources/en-US/Resources.resw (+3 -0)
📝 src/cascadia/TerminalApp/Tab.cpp (+170 -15)
📝 src/cascadia/TerminalApp/Tab.h (+8 -1)
📝 src/cascadia/TerminalApp/TerminalPage.cpp (+12 -10)

📄 Description

Summary of the Pull Request

Adds support for setting, from the UI, a runtime override for the tab title text. The user can use this to effectively "rename" a tab.

If set, the tab will always use the runtime override string. If the user has multiple panes with different titles in a pane, then the tab's override text will be used regardless of which pane was focused when the tab was renamed.

The override text can be removed by just deleting the entire contents of the box. Then, the tab will revert to using the terminal's usual title.

References

  • Wouldn't be possible without the context menu from #3789
  • Focus doesn't return to the active terminal after hitting enter/esc, but that's tracked by #5750

PR Checklist

TODO

  • Tab::SetTabText might be able to be greatly simplified/removed?
  • I'm pretty sure if they set an override title, we won't bubble that up to set the window title.
  • I'm unsure how this behaves when the terminal's title changes while the TextBox is visible. I don't think it should change the current contents of the box, but it might currently.
  • for discussion: If the user doesn't actually change the text of the tab, then we probably shouldn't set the override text, right?
    • EX: if they open the box and the text is "cmd", and immediately hit enter, then run title foo, should the text change to "foo" or stay "cmd"?

Detailed Description of the Pull Request / Additional comments

image
image
image
image
image
image
image
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/5775 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 5/6/2020 **Status:** ✅ Merged **Merged:** 5/28/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/migrie/f/1079-rename-tab` --- ### 📝 Commits (10+) - [`19ab0ee`](https://github.com/microsoft/terminal/commit/19ab0ee55d2d668f7d97c1fa6b0675c096fd2fdd) This _looks_ alright, but it's a horrible hack - [`742282a`](https://github.com/microsoft/terminal/commit/742282a22f66e9ed956a6f8574657ccd50a18535) Some minor cleanup of the previous commit - [`a0e36e9`](https://github.com/microsoft/terminal/commit/a0e36e9b7445fb9747fca7add62e9786752ee6e5) accidentally the whole thing - [`24f11eb`](https://github.com/microsoft/terminal/commit/24f11ebcadd951b076aff229f246b440dab23633) Cleanup for review - [`bf4c421`](https://github.com/microsoft/terminal/commit/bf4c4217013ca3256e9d2e1905b4bc2522dd6262) Update src/cascadia/TerminalApp/Tab.cpp - [`466e926`](https://github.com/microsoft/terminal/commit/466e9261257ab7eb93ddeca4e883e75de5b94651) Merge remote-tracking branch 'origin/master' into dev/migrie/f/1079-rename-tab - [`28ba1eb`](https://github.com/microsoft/terminal/commit/28ba1eb8d92daa40c7cfb3912a77bd407fcfadb5) when the tab is renamed, bubble the value up to the window title - [`8a682d8`](https://github.com/microsoft/terminal/commit/8a682d85813efa9e7e4fbc2aef6b5207c187c9c9) Don't reset the text box when the title changes underneath us - [`b47f43a`](https://github.com/microsoft/terminal/commit/b47f43a7cdef8de39fcf9f99083cf2fef032f1e4) get rid of this outstanding todo - [`cab6c22`](https://github.com/microsoft/terminal/commit/cab6c2217ac6f5a8a4b88243f240b7441aba3057) good bot ### 📊 Changes **4 files changed** (+193 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/Resources/en-US/Resources.resw` (+3 -0) 📝 `src/cascadia/TerminalApp/Tab.cpp` (+170 -15) 📝 `src/cascadia/TerminalApp/Tab.h` (+8 -1) 📝 `src/cascadia/TerminalApp/TerminalPage.cpp` (+12 -10) </details> ### 📄 Description ## Summary of the Pull Request Adds support for setting, from the UI, a runtime override for the tab title text. The user can use this to effectively "rename" a tab. If set, the tab will _always_ use the runtime override string. If the user has multiple panes with different titles in a pane, then the tab's override text will be used _regardless_ of which pane was focused when the tab was renamed. The override text can be removed by just deleting the entire contents of the box. Then, the tab will revert to using the terminal's usual title. ## References * Wouldn't be possible without the context menu from #3789 * Focus doesn't return to the active terminal after hitting <kbd>enter</kbd>/<kbd>esc</kbd>, but that's tracked by #5750 ## PR Checklist * [x] Closes #1079 * [x] I work here * [ ] Tests added/passed * [ ] Requires documentation to be updated ## TODO * [x] `Tab::SetTabText` might be able to be greatly simplified/removed? * [x] I'm _pretty sure_ if they set an override title, we won't bubble that up to set the window title. * [x] I'm unsure how this behaves when the terminal's title changes _while_ the TextBox is visible. I don't think it should change the current contents of the box, but it might currently. * [ ] **for discussion**: If the user doesn't actually change the text of the tab, then we probably shouldn't set the override text, right? - EX: if they open the box and the text is "cmd", and immediately hit <kbd>enter</kbd>, then run `title foo`, should the text change to "foo" or stay "cmd"? ## Detailed Description of the Pull Request / Additional comments ![image](https://user-images.githubusercontent.com/18356694/81230615-713f9180-8fb7-11ea-8945-6681eec02a4f.png) ![image](https://user-images.githubusercontent.com/18356694/81230640-7ac8f980-8fb7-11ea-9e6b-22f0e0ed128a.png) ![image](https://user-images.githubusercontent.com/18356694/81230665-86b4bb80-8fb7-11ea-90f0-16d4ffb60d89.png) ![image](https://user-images.githubusercontent.com/18356694/81230686-9207e700-8fb7-11ea-94a9-f3f5a59be139.png) ![image](https://user-images.githubusercontent.com/18356694/81230732-a350f380-8fb7-11ea-9901-6dd4f36154f1.png) ![image](https://user-images.githubusercontent.com/18356694/81230746-a8ae3e00-8fb7-11ea-94fa-d2578f9241a7.png) ![image](https://user-images.githubusercontent.com/18356694/81230787-bc59a480-8fb7-11ea-8edf-2bd7fad343fc.png) ![image](https://user-images.githubusercontent.com/18356694/81230851-dc896380-8fb7-11ea-98c1-918b943543e4.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:16:16 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26465