-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Split Panes inherit tab color and title of active pane #18981
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
base: main
Are you sure you want to change the base?
Split Panes inherit tab color and title of active pane #18981
Conversation
bf4dde3
to
c5bc0ea
Compare
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.
Ok, I did some digging and played around with the branch. It looks like this change made it so that duplicatePane
copies over the tab title and tab color. That's good, but we still need to copy those over for splitPane
.
This also doesn't fix the issue described in #18930, which is basically that if you run this:
wt new-tab -p "Windows PowerShell" --tabColor "#FF0000" --title "Hello World" ; split-pane -p "Windows PowerShell"
Both panes are expected to have the tab color and title set.
Implementation-wise, it looks like _MakeTerminalPane(newTerminalArgs, sourceTab, existingConnection)
's sourceTab
is only set if we're duplicating a pane (passed in by _MakePane(contentArgs, sourceTab, existingConnection)
's sourceTab
. Maybe that context always has to be passed along, and we'll need a separate parameter to track if we're duplicating a pane?
I thought split pane on the UI and split pane via CLI would use the exact same path but the fact that when i run the command you suggested (also in original issue) it doesnt retain title tells me this is not the case... I will see how to fix this thanks |
Previously to this PR if you split a pane as suggested in microsoft#18930, the split pane will lose its custom title and will not have its custom color, with this PR it will keep as indicated
c5bc0ea
to
558a396
Compare
if (!duplicateFromTab && terminalTab.get()) | ||
{ | ||
_SplitPane(terminalTab, | ||
realArgs.SplitDirection(), | ||
// This is safe, we're already filtering so the value is (0, 1) | ||
realArgs.SplitSize(), | ||
_MakePane(realArgs.ContentArgs(), *terminalTab.get())); | ||
} |
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.
So i came up with a way that works (fallback to terminalTab which is the 'sender/focused tab' as getFocused will always be null for the case described above;
@carlos-zamora i've done a bit of testing but do you think i might be missing a edge case where this would cause a bug?
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (1)ebefore These words are not needed and should be removedabcd ABCDEFGHIJ abcdefghijk ABCDEFGHIJKLMNOPQRS ABCDEFGHIJKLMNOPQRST ABCDEFGHIJKLMNOPQRSTUVWXY allocs appium Argb asan autocrlf backported bytebuffer cac CLE codenav codepath commandline COMMITID componentization constness dealloc deserializers DISPATCHNOTIFY DTest entrypoints EVENTID FINDUP foob fuzzer fuzzyfinder hlocal hstring IInput Interner keyscan lstrcmpi Munged numlock offboarded oob pids positionals Productize pseudoterminal remoting renamer roadmap ruleset SELECTALL somefile Stringable tearoff TODOs touchpad TREX Unregistering USERDATA vectorize viewports wslTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the git@github.com:Techypanda/terminal.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/15435220146/attempts/1'
Errors (1)See the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. ✏️ Contributor please read thisBy default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later. If the listed items are:
See the 🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉 If the flagged items are 🤯 false positivesIf items relate to a ...
|
Summary of the Pull Request
Previously to this PR if you split a pane as suggested in #18930, the split pane will lose its custom title and will not have its custom color, with this PR it will keep as indicated.
References and Relevant Issues
Detailed Description of the Pull Request / Additional comments
This PR makes it so that when you perform a split on a pane, it will copy the title and color of the source tab to make it stay.
Validation Steps Performed
.\WindowsTerminal.exe -p "Windows PowerShell" --tabColor "#FF0000" --title "Hello World"
PR Checklist