mobile-shell / mosh

Mobile Shell
https://mosh.org
GNU General Public License v3.0
12.59k stars 729 forks source link

Getting errors when using fish shell #1262

Closed skrat closed 1 year ago

skrat commented 1 year ago

This is a new thing, possibly a new bug introduced in a recent version.

My user's shell is fish. When I mosh to my server, I'm getting errors related to my fish init file (~/.config/fish/config.fish)

~ $ mosh ***my-server***
~/.config/fish/config.fish (line 15): Unknown command: fish_add_path
fish_add_path $HOME/.local/bin
^~~~~~~~~~~~^
from sourcing file ~/.config/fish/config.fish
    called during startup
~/.config/fish/config.fish (line 16): Unknown command: fish_add_path
fish_add_path $HOME/.pub-cache/bin
^~~~~~~~~~~~^
from sourcing file ~/.config/fish/config.fish
    called during startup
~/.config/fish/config.fish (line 17): Unknown command: fish_add_path
fish_add_path $HOME/.ebcli-virtual-env/executables
^~~~~~~~~~~~^
from sourcing file ~/.config/fish/config.fish
    called during startup
~/.config/fish/config.fish (line 24): Unknown command: alias
alias vim=nvim
^~~~^
from sourcing file ~/.config/fish/config.fish
    called during startup

[mosh is exiting.]
~ 4s $ ssh ***my-server***
Last login: Wed Mar  8 01:21:50 2023 from ***some-ip***
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
skrat@svali ~>
Connection to ***my-server*** closed.
~ 3.7s $

This also happens when I switch to bash before invoking mosh. Even when I run a new terminal emulator with bash. This is super odd. Any ideas?

achernya commented 1 year ago

I see no evidence that this is caused by mosh. https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1961365 has similar issues reported. I'm guessing you have different versions of fish and incompatible dotfiles.

skrat commented 1 year ago

@achernya I've read through it, it's not related. I came here for help, since this is new, and it does not happen when using ssh. It also doesn't happen when I just launch a terminal emulator with fish. I find it odd that it manifests when invoking mosh. I thought y'all might have some insight, but if not, that's ok. Thank you

achernya commented 1 year ago

Mosh doesn't do anything that could affect fish in this way. I strongly suggest you ask the fish folks for help.

eminence commented 1 year ago

One possible difference between ssh and mosh is the server-side env, so that might be worth checking too

skrat commented 1 year ago

Just to report back on this: it was caused by firejail and ssh. Firejail creates symlink in /usr/local/bin/ssh that points to firejail and that in turn runs ssh in some restriced mode. By using --ssh=/usr/bin/ssh those errors went away.