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

tmux: versions later than 3.4 break default shell behaviour on darwin #348103

Closed
x123 opened this issue Oct 12, 2024 · 5 comments
Closed

tmux: versions later than 3.4 break default shell behaviour on darwin #348103

x123 opened this issue Oct 12, 2024 · 5 comments
Labels
0.kind: bug Something is broken

Comments

@x123
Copy link
Contributor

x123 commented Oct 12, 2024

Describe the bug

The following commit 80931ba pushing tmux to 3.5 appears to cause the users shell to not be respected inside of a tmux session on nix-darwin, always falling back to /bin/sh no matter if the default-shell option is set correctly or not.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Use tmux 3.5 or later (commit 80931ba or newer) on a nix-darwin system
  2. Observe that you are always defaulted to /bin/sh, despite having another shell defined as default (both natively via chsh or by forcing default-shell in tmux)

Expected behavior

tmux respects and uses the correct user shell as it did in 3.4 and below.

Additional context

For now I need to revert to tmux 3.4, and I'm using the following overlay:
x123/dotfiles@1808a2e#diff-4c16758b5c5c0626884ec3692e2130e50cc772d436e95e2e0257fbee75b9cfe9R6

Notify maintainers

@matthiasbeyer

Metadata

$ nix run nixpkgs#nix-info -- -m
 - system: `"aarch64-darwin"`
 - host os: `Darwin 24.0.0, macOS 15.0.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.8`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/store/fpivx4sjcp2vk4rp9nhliln5cwcp3kc6-source`

Add a 👍 reaction to issues you find important.

@x123 x123 added the 0.kind: bug Something is broken label Oct 12, 2024
@Atemu
Copy link
Member

Atemu commented Oct 13, 2024

Is this an upstream bug?

@matthiasbeyer
Copy link
Contributor

I like to believe that this is an upstream bug. Is there a way we can confirm that this is not an nix issue?

@x123
Copy link
Contributor Author

x123 commented Oct 13, 2024

Good point, I don't have a way to replicate it ATM because all my machines are nixos or nix-darwin. There is a comment here that I think may be involved in the issue:

"Revert to using /bin/sh for #(), run-shell and if-shell - only popups change to use default-shell." (in tmux/tmux#4162)

I will comment on this issue and see if anyone else notices this behavior.

@x123
Copy link
Contributor Author

x123 commented Oct 13, 2024

According to upstream tmux (tmux/tmux#4162) this appears to be a bug in tmux-sensible which is being implemented in my case by the home-manager programs.tmux directives.

"Note that a fix in 3.5 and 3.5a to correctly set SHELL for run-shell and if-shell reveals a bug in the tmux-sensible script, causing it to set default-shell to /bin/sh. This can be worked around by adding this to .tmux.conf after the tmux-sensible script is invoked:"

There is already a bug report in with home-manager: nix-community/home-manager#5952

Probably possible to close this one now, and wait for the HM fix.

@Atemu Atemu closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2024
@charlottia
Copy link

@x123 thanks for documenting this issue and what you tracked down so clearly, stopped me pulling my hair out for too long! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

4 participants