feat: Windows Terminal-like new-tab profile dropdown - #38
Merged
Conversation
Add a `▾` button next to the tab-bar `+` that opens a dropdown listing
the configured [[profiles]] and WSL distros detected at startup, so a
new tab can be opened directly with a specific shell / cwd / env —
matching the Windows Terminal new-tab UX.
- proto: new `ClientToServer::SplitWithShell { program, args, cwd, env }`
appended at the enum tail; PROTOCOL_VERSION 10 -> 11 (postcard tags
variants positionally). Postcard round-trip tests included.
- server: `Pane::spawn_with_options` gains extra-env support (applied via
`CommandBuilder::env`); `Window::add_pane_with_options` takes a cwd
override falling back to parent-CWD inheritance; `handle_split_with`
threads the override through the existing split path. The unused
`add_pane` wrapper is removed.
- client: fix the `OpenProfile` context-menu stub that only sent a plain
`SplitVertical` and logged — it now resolves the profile (config
profiles first, then cached WSL distros) via the pure
`split_message_for_profile` helper (falls back to the session default
shell for cwd/env-only profiles; env sorted for determinism).
- client UI: `ContextMenu::new_tab_dropdown` constructor reusing the
existing menu rendering/hit-testing; `▾` pill drawn right of `+` with
a per-frame `new_tab_dropdown_hit_rect`; WSL distros cached once at
startup in `ClientState.wsl_profiles`.
- i18n: new `tab-dropdown-new-tab` key in all 8 locales.
Tests: 6 new unit tests (menus) + 2 proto round-trips; full suite green
(cargo test / clippy -D warnings with the existing question_mark
allowance / fmt).
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Coverage reportGenerated by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First phase (P1) of the Windows-Terminal-like UX plan (
docs/plans/2026-07-29-windows-terminal-like-ux.md): a▾button next to the tab-bar+opens a dropdown listing the configured[[profiles]]and the WSL distros detected at startup. Selecting an entry opens a new tab running that profile's shell, working directory, and environment.What was broken before
The context-menu profile entries (
OpenProfile) were a stub: they sent a plainSplitVerticaland only logged the profile's shell. Profiles'shell/working_dir/envwere never wired into PTY spawn.Changes
ClientToServer::SplitWithShell { program, args, cwd, env }appended at the enum tail; PROTOCOL_VERSION 10 → 11 (postcard tags variants positionally). Round-trip tests for minimal/full payloads.Pane::spawn_with_optionsapplies extra env viaCommandBuilder::env;Window::add_pane_with_optionsaccepts a cwd override (falls back to the existing parent-CWD inheritance);handle_split_withthreads the override through the existing split path (hooks / auto-log / layout broadcast unchanged). The now-unusedadd_panewrapper was removed.OpenProfileresolves the profile (config profiles first, then cached WSL distros) via the puresplit_message_for_profilehelper. cwd/env-only profiles run the session default shell in that directory;envis sorted for determinism.ContextMenu::new_tab_dropdownreuses the existing context-menu rendering/hover/click machinery; the▾pill is drawn right of+with a per-frame hit rect; WSL detection runs once at startup (CREATE_NO_WINDOWalready in place, no console flash).tab-dropdown-new-tabadded to all 8 locales (non-en/ja are first-pass translations).Test plan
cargo test— full workspace green (720 client / 40 proto / 273+ server; 8 new tests)cargo clippy --workspace --all-targets— no new warnings (only the pre-existingquestion_markallowance)cargo fmt --check▾opens the dropdown under the tab bar; a[[profiles]]entry withshell/working_dirspawns correctly; WSL distros listed and launch viawsl.exe -d; right-click profile entries now actually launch the profile shell▾glyph renders with the bundled font fallbacksCompatibility
PROTOCOL_VERSION bump: the single-binary
nextermships both halves, so upgrades are atomic for normal users. Standalonenexterm-serverdeployments must update server and clients together (the server drops mismatched connections during Hello, per the existing versioning contract).🤖 Generated with Claude Code