-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 split window does NOT use current directory after installation of fish release 3 #5699
Comments
There's no need to set both default-command and default-shell. Doing so will end up running Also it turns out that not doing it does not trigger the issue. I'm not quite sure what's actually happening here, but that's a great workaround because it's what you should be doing in the first place. |
Right, gotcha.. Thank. This doesn't appear to have any impact on my site, however. |
Okay, so, the way tmux reads the pwd for this is os-dependent and actually kind of weird. On linux it boils down to Which in case you're doing If you use bash as default-shell, then that boils down to If you run a command, that also works as fish puts it in its own pgroup in control of the terminal. I'm unsure why in @mqudsi: Any ideas? |
Oh I see, you nailed it.. setting default-shell to EDIT: I had to put both of these into |
@CermakM: Please try setting just default-shell to fish and leaving default-command undefined. That works for me, and seems like what you should do, normally. |
@faho, works now, after I've sourced the default-shell command .. now I can leave it out and the tmux still works as expected. Maybe uses some sort of cache / artifact mechanism? No idea. |
I did a clean reinstall to Fedora 30 and ran into the same issue once again. I managed to solve it by setting the default shell to be fish system-wise by running |
I have the same issue after upgrading to Ubuntu 19.04, which upgraded fish to 3.0.2. I don't get the problem, if I'm running any application when splitting the window. |
Yup. Which I tried changing in a local branch before the 3.0 release but that broke a few subtle things we don't have tests for (because our current test system doesn't make that easy). I don't know if there's a very small subset of actions we currently do in job control mode that we can safely do always, regardless of how fish is being invoked. |
I'm having the same issue. changing |
I just started seeing something like this… it's really weird. It happens even if I comment out my whole I started to record an asciinema to demonstrate, but that weirded it out too. Here's a (too fast) screencast via gif… |
Another weird wrinkle for those still debugging this puzzle… pressing the binding that I have sends (I'm using https://github.com/tmux-plugins/tmux-pain-control for the binding for split…) |
after trying the previous solutions again, setting this will also only work after creating a new window. you can have it work on current windows by running |
@fent weirdly… that worked on one computer but not the other… I believe they share exactly the same dotfile�s… so I have no clue what's going on. ¯(°_o)/¯ |
hmm, one thing I can think of is maybe you don't have your shell set to fish in the other computer, or an env variable is missing? |
both computers have the shell set to homebrew's version of fish:
I track my dotfiles in git, so theoretically there shouldn't be anything in the fish directory that's not tracked… I believe all my shell variables are set by the |
For anyone who cares… I thought that perhaps the difference between the two computers was that one was set up from scratch to use fish and the other had been lived in for a while… that wasn't it. I wiped the older computer and started from scratch and I still see the bug. ¯(°_o)/¯ |
My 3 cents: In my case, that line was the reason:
It was there to fix the pastebin on OS X . However, after removing it, the pastebin still works, and the problem from this issue also disappeared. |
@jtomaszewski are you using any plugins for tmux? I'm pretty sure that I get that setup through tmux-sensible, and I'm not sure how to overwrite it. |
Not a plugin, just some my old dotfile . |
I'm just now testing this… and commenting out tmux-sensible seems to help me. |
Same issue with fish 3.1.0. |
Today at work, I noticed that everything was okay with Back at home, I set the default shell in That's ok for me. Now I use gnome-terminal for tmux (byobu) and I can set fish as default command in terminator when I don't want to use tmux. But please tell me when you find tmux settings that work when |
@jtomaszewski 's comment in #5699 (comment) worked for me too. |
the commit referenced just above worked for me |
Thanks @gpanders and @fent this gave me the keys to find a solution that worked for me, with specifications of my case detailed in #7017 that @faho just closed pointing me to here. Thanks @faho for the hint. By the way, @evantravers, maybe your Tmux profile source a system file, whose content might vary from one system to an other? In my case byobu had
However in my case launching a bright new Byobu window happen to finish in a |
So, here is something is completely functioning (for me): #!/bin/sh
:<<:about:
Fix initial shell set up when opening a new a Tmux session.
See https://github.com/fish-shell/fish-shell/issues/5699 for more information.
This is intended to be used in combination with a Tmux configuration such as:
set-environment -g ENV $HOME/.config/byobu/enforce_user_shell.sh
set -g default-shell /bin/sh
set -g default-command $SHELL
NOTE: Fit ENV set up above to match the current script.
:about:
# If Tmux did `set -g default-shell /bin/sh`
[[ $SHELL = '/bin/sh' ]] || exit
# POSIX test for “$TERM starts with 'screen'”, matching "screen-256color" too
case "$TERM" in screen*) true ;; *) false ;; esac || exit
# Open a new tmux window, not impacted by the bug, at position 0 and exit
tmux move-window -s0 -t2 && tmux new-window -t0 && exit Now launching a new Byobu window will end up in a Fish session not affected by the bug. I had first attempted to launch fish in the provided sh, but this was still affected by the bug, unlike any further spawned shell pane. Note that the script need the |
I was running into this issue too. However, I don't care so much about having splits open in the same directory. I just want to easily be able to change a session's default directory (for splits and new windows). I'm sharing my solution in case it helps others. You can change the directory with #!/bin/bash
if ! [[ -n "$TMUX" ]]; then
echo "not in a tmux session" >&2
exit 1
fi
TMUX= tmux attach -c "$(pwd)" -t . \; detach < /dev/null > /dev/null 2>&1 || : This attaches to the current session with the So, you can run this script directly, or make an alias in your fish config for easy access. |
Was having this issue on Arch! This fixed it. |
Tmux split window does NOT use current directory after installation of fish release 3.
I tried setting the following from
fish
tobash
, but the issue is the same. I don't know anything about the underlying connection of fish and tmux. However, this issue occured right after the installation of fish release 3.The relevant tmux config lines:
Fish version
> fish --version fish, version 3.0.2
Thanks for the help!
The text was updated successfully, but these errors were encountered: