fix(shell_integration): set window title on startup#12569
fix(shell_integration): set window title on startup#12569fdncred merged 4 commits intonushell:mainfrom
Conversation
crates/nu-cli/src/repl.rs
Outdated
| } | ||
|
|
||
| if shell_integration { | ||
| do_shell_integration(System::host_name(), engine_state, &mut unique_stack); |
There was a problem hiding this comment.
- I'd rather get this host_name() once and use pass it through. Seems like that minor refactor would help.
- I also think
do_shell_integration()should be named something else since it's only part of the shell integration. Not you're fault, of course, but you are renaming it here. Maybeshell_integration_osc_7_633_2()?, which leads us to another PR which could separate those.
I'm up for other names.
There was a problem hiding this comment.
Both good comments that address things that were bugging me too whilst I was writing this PR — I'll have a quick think about if any other name would be better, but otherwise I'll make these changes ASAP!
|
Other than my comment above, I think is ok. You're really just running the "do_shell_integration" sooner in order to give OSC2 functionality. I see this PR as a first step toward separating the shell_integration functions. |
|
Hopefully this is what you were after, @fdncred ? |
|
Yup! That's my bad, but a good sign that the refactor opens the door to simplify things even more with a clippy lint! I'll sort that out now! |
|
Ready for workflow approval! |
|
Thanks |
Should close #10833 — though I'd imagine that should have already been closed.
Description
Very minor tweak, but it was quite noticeable when using Zellij which relies on OSC 2 to set pane titles. Before the change:

Note that the default
Pane #1is still showing for the untouched shell, but running a command likehtoporlscorrectly sets the title during / afterwards.After this PR:

There are now no-longer any unset titles — even if the shell hasn't been touched.
As an aside: I feel quite strongly that (at least OSC 2) shell integration should be enabled by default, as it is for every other Linux shell I've used, but I'm not sure which issues that caused that the default config refers to? Which terminals are broken by shell integration, and could some of the shell integrations be turned on by default after splitting things into sub-options as suggested in #11301 ?
User-Facing Changes
You'll just have shell integrations working from right after the shell has been launched, instead of needing to run something first.
Tests + Formatting
Not quite sure how to test this one? Are there any other tests that currently exist for shell integration? I couldn't quite track them down...
After Submitting
Let me know if you think this needs any user-facing docs changes!