-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting terminal window title #2200
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2200 +/- ##
==========================================
- Coverage 99.46% 98.94% -0.53%
==========================================
Files 72 73 +1
Lines 7339 7606 +267
==========================================
+ Hits 7300 7526 +226
- Misses 39 80 +41
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -51,3 +51,6 @@ def legacy_windows_render(buffer: Iterable[Segment], term: LegacyWindowsTerm) -> | |||
term.erase_start_of_line() | |||
elif mode == 2: | |||
term.erase_line() | |||
elif control_type == ControlType.SET_WINDOW_TITLE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Did you test this on the Windows laptop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did yeah, works well there. It even automatically resets the title on both Windows Terminal and legacy Windows, so it's actually even better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Type of changes
Checklist
Description
Adds support for setting the title of the terminal window.
There is no means within Rich of "resetting" the window title to its
previous value, meaning the title you set will persist even after your application
exists.
fish
shell resets the window title before and after each command by default,negating this issue. Windows Terminal and command prompt will also reset the title for you.
Most other shells and terminals, however, do not do this.
Some terminals may require configuration changes before you can set the title.
Some terminals may not support setting the title at all.
Other software (including the terminal itself, the shell, custom prompts, plugins, etc.)
may also set the terminal window title. This could result in whatever value you write
using this method being overwritten.