Repository navigation
fix(tmux): wrap sidebar spawn in sh -c for fish shell compatibility and protect daemon with nohup - #65
Open
vishal4meena wants to merge 1 commit into
Conversation
- Wrap spawn_sidebar command in sh -c '...' so split-window works when tmux default-shell is fish or other non-POSIX shells - Escape session name and window id in sidebar spawn command - Use nohup when launching opensessions-server in ensure_server to protect background daemon from SIGHUP
There was a problem hiding this comment.
inspect review
Triage: 3 entities analyzed | 0 critical, 0 high, 3 medium, 0 low
Verdict: standard_review
Findings (0)
Reviewed by inspect | Entity-level triage found 0 high-risk changes
Member
|
we are not actively maintaining this project anymore, but you can find out a lot of cool things happening at herdr. Check that out. |
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.
Problem
When tmux has
default-shellset to Fish (or another non-POSIX shell), opening the sidebar (prefix + o -> sorprefix + o -> t) causes the sidebar pane to open for a fraction of a second and immediately disappear.Root cause:
opensessions-servergenerates the following command string fortmux split-window:split-windowvia$default-shell -c "<command>", tmux delegates execution directly to Fish.VAR=val cmd) or POSIX parameter default expansions (${VAR:-default}). Fish immediately fails with:pane-diedhook promptly cleans up the dead pane.ensure_serverinserver-common.shbackgrounded the server binary withoutnohup, leaving the background process vulnerable to SIGHUP when the invoking subshell closes.Solution
sh -c: Inpackages/runtime-rs/src/tmux_provider.rs, wrap the spawn command string insh -c '...'and escape single quotes in session and window identifiers. This guarantees execution through POSIX/bin/shregardless of the user'sdefault-shell.nohupinserver-common.sh: Launchopensessions-serverwithnohupto prevent SIGHUP termination.Verification
default-shellon macOS.prefix o s) and toggle (prefix o t) reliably spawn the sidebar, resize cleanly, maintain WebSocket connection, and stash/close on toggle.cargo test -p opensessions-runtime(all 21 unit tests pass) andcargo test -p opensessions-sidebar-core(all 29 unit tests pass).