faq: Reword ssh question

This was a bit stuffy

Also let's mention tmux because that's another thing that may cause this.
This commit is contained in:
Fabian Homborg
2021-03-08 22:28:12 +01:00
parent 76f7b3e98e
commit 4218c1f1a4

View File

@@ -301,20 +301,24 @@ The ``open`` command uses the MIME type database and the ``.desktop`` files used
Why won't SSH/SCP/rsync connect properly when fish is my login shell?
---------------------------------------------------------------------
This problem may manifest as messages such as "``Received message too long``", "``open terminal
This problem may show up as messages like "``Received message too long``", "``open terminal
failed: not a terminal``", "``Bad packet length``", or "``Connection refused``" with strange output
in ``ssh_exchange_identification`` messages in the debug log.
These problems are generally caused by the :ref:`user initialization file <initialization>` (usually
``~/.config/fish/config.fish``) producing output when started in non-interactive mode.
This usually happens because fish reads the :ref:`user configuration file <initialization>` (``~/.config/fish/config.fish``) *always*,
whether it's in an interactive or login or non-interactive or non-login shell.
This simplifies matters, but it also means when config.fish generates output, it will do that even in non-interactive shells like the one ssh/scp/rsync start when they connect.
Anything in config.fish that produces output should be guarded with ``status is-interactive`` (or ``status is-login`` if you prefer)::
All statements in initialization files that output to the terminal should be guarded with something
like the following::
if status is-interactive
...
end
The same applies for example when you start ``tmux`` in config.fish without guards, which will cause a message like ``sessions should be nested with care, unset $TMUX to force``.
.. _faq-unicode:
I'm getting weird graphical glitches (a staircase effect, ghost characters,...)?