Skip to content
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

Use tmux's default-shell opt to get preffered SHELL for default-command in OSX #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

venlinz
Copy link

@venlinz venlinz commented Nov 17, 2024

tmux-sensible modified default-command for OSX to use reattach-to-user-namespace when creating shell with user preffered shell type from SHELL environment variable for circumventing OSX's process namespace segregation.
Prior to tmux 3.5 this SHELL environment variable was not modified by Tmux when running a shell command with tmux's default sh shell, so this worked fine.
Now from tmux 3.5 SHELL environment variable is set to sh, this causes tmux to load sh shell when executing default-command instead of user preffered shell when using tmux-sensible plugin.
This fixes the issue.

…mmand` in OSX

tmux-sensible modified `default-command` for OSX to use
`reattach-to-user-namespace` when creating shell with user
preffered shell type from `SHELL` environment variable for circumventing
OSX's process namespace segregation.
Prior to tmux 3.5 this `SHELL` environment variable was not modified by Tmux
when running a shell command with tmux's default `sh` shell, so this
worked fine.
Now from tmux 3.5 `SHELL` environment variable is set to `sh`, this
causes tmux to load `sh` shell when executing default-command instead of
user preffered shell when using tmux-sensible plugin.
@venlinz
Copy link
Author

venlinz commented Nov 19, 2024

@bruno- can you please validate and pull this MR?

@venlinz
Copy link
Author

venlinz commented Nov 21, 2024

@bruno- I've got a friendly reminder to pull this changes.

@@ -100,7 +105,7 @@ main() {

# required (only) on OS X
if is_osx && command_exists "reattach-to-user-namespace" && option_value_not_changed "default-command" ""; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the reattach-to-user-namespace documentation, this command is no longer necessary after Tmux 2.6 so I think it would be great if you could change the condition to only set the default-command based on the version of tmux

ChrisJohnsen/tmux-MacOSX-pasteboard@77b3004

webframp added a commit to webframp/dotfiles that referenced this pull request Dec 10, 2024
There's a bug between current tmux 3.5a and tmux-sensible@25cb91f that
makes it always use sh instead of correct $SHELL

https://discourse.nixos.org/t/tmux-use-bash-instead-defined-zsh-in-home-manager/54763/2
nix-community/home-manager#5952

will need fix here:
- tmux-plugins/tmux-sensible#75

but I may not actually need sensible at all with home-manager tmux config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants