CLI is the default frontend if you requesting a reglar shell session without command; you can also use command cli in SSH exec channel request to request this frontend.
If a pseudoterminal is requested and available, readline library will be used in this frontend to enable user friendly line editing and auto-completing features; since version 1.2, readline support can also be forcibly enabled even without a PTY, by passing an environment variable, see chapter Other useful environment variables for details.
Input lines that start with a slash / are interpreted as commands. Following commands are supported as of version 1.1:
| Command | Description |
|---|---|
| who | print currently on-line users |
| list | alias of who |
| alert | whether to run the terminal bell on every message |
| bell | alias of alert |
| showhtml | whetcher to print HTML messages |
| msg | send a private message to specified user |
| tell | alias of msg |
| motd | print the message of the day from server if available |
| pasteimage | send an image via X11 forwarding to specified user, X11 forwarding must be available in both SSH client and server |
| listoptions | list all CLI options and current values |
| version | print version and copyright information of the server side programs |
| quit | quit current session |
| help | print brief usage lines of all commands |
Under some configurations, CLI frontend cannot accept multibyte characters input. This is due to the readline library don't recognize multibyte characters if it isn't told to do, by environment variable LANG or LC_CTYPE. if SSH client don't sent vaild locale environment variables to server side, or if the SSH server dont't accept the variables from client, readline will handle only ASCII inputs. A vaild LANG or LC_CTYPE variable must begin with a language code, then an optional encoding type, separated by a dot; for example, en_US.UTF-8. en_US specifies your language, and UTF-8 specifies your encoding. Readline need to know your encoding type to enable correct input support for that encoding.
If both LANG and LC_CTYPE are set, LC_CTYPE will take effect for text encoding; text encoding in readline will malfunction if LC_CTYPE has a invalid format even LANG is correctly set. Note that setting LANG will also affecting the UI language. Some operating systems support a built-in locale C.UTF-8, that denotes a default language with UTF-8 encoding; so if the server supports it, using this locale is recommended for users who prefer a non-localized environment with UTF-8 support.
See setlocale(3) for more information about locale categories and the available locales.
To test whether this issue is at server side, use this command line:
LANG=en_US.UTF-8 ssh sshout@example.com -o SendEnv=LANG
If the issue gone, meaning the server side configuration is fine, and you need to configure your shell and/or SSH client.
Putting option SendEnv LANG into ssh_config(5) is recommended, so you won't need to use -o SendEnv=LANG everytime with ssh(1). ssh_config(5) is usually loacted at /etc/ssh/ssh_config and ~/.ssh/config; check the man page in your OS for details. You can use LC_CTYPE instead if you prefer that.
See later chapter Passing custom environment variables from command line with SSH client for more information on passing environment variables from command line.
Of course when setup a server, you should configure your SSH server to accept the LANG and/or LC_CTYPE variable that sent by client. Make sure something like AcceptEnv LANG exists in your sshd_config(5) (usually at /etc/ssh/sshd_config).
Some operating systems may lack the support of the modifier in locale variables; for example a LANG variable of zh_CN.UTF-8@cjknarrow may break the locale support in such a system. If that the case, remove the modifier (anything starts from the '@' character) from your locale environment variables, before connecting.
In addition to LANG and LC_CTYPE variables describe above, there are some other varables that could control the behavior of the CLI frontend.
Again the SSH server must be configured to accept those environment variables so they could be passed to sshoutd if available. For example in sshd_config(5):
Match user sshout
AcceptEnv TZ RL_*
Note here the AcceptEnv is limited to the sshout user only, as a recommendation; because it may be considered insecure to accept all of those environment variables globally.
This variable can change the timezone for message timestamps, as well as the timezone for controlling the day-change notify message.
See tzset(3) for formats.
For security reason only timezone offset or a relative path containing no '..' directory name, are accepted.
This variable change the editing mode of Readline, if Readline is going to be used.
Acceptable values are emacs for EMACS-like key-binding, and vi for Vi-like key-binding.
The default setting are platform-depended, but is usually emacs.
Available since version 1.2.
Normally the Readline is not used if PTY isn't requested by SSH client (implemented by detecting whether a client mode sshoutd has a terminal as its stdin, this is a technical detail), but if this variable is defined to anything other than empty string, Readline support will be forcibly enabled.
This could be useful if you need to pipe the output from this frontend to another program, but the SSH client redirected stderr to stdout when PTY is enabled, leading your own input echos being piped as well.
If you are going to enable Readline support in a terminal without requesting PTY to SSH server (for example, by passing option -T to ssh(1)), you may need to reconfigure your local terminal to disable input line buffering and local echoing; this could be done by using stty(1) command, like:
stty -icanon -echo
To revert the changes after you left chat, run:
stty icanon echo
Available since version 1.2.
Different SSH clients may have very different ways to pass environment variables to a server, following examples applying for OpenSSH ssh(1) command only.
If you have OpenSSH version 7.7 or later, there is a SetEnv option available for passing enviroment variables directly from ssh(1) command line, for example:
ssh -o "SetEnv LANG=en_GB.UTF-8 TZ=UTC RL_EDITING_MODE=vi" ...
otherwise define the environment variables for ssh(1) and use SendEnv to allow them to be passed:
LANG=en_GB.UTF-8 TZ=UTC RL_EDITING_MODE=vi ssh -o "SendEnv LANG TZ RL_EDITING_MODE" ...