mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-30 04:23:36 +08:00
[ssh plugin] 256-colour helper stuff
This commit is contained in:
parent
818e68b9bc
commit
ad63831b8f
20
plugins/ssh/README.md
Normal file
20
plugins/ssh/README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
## ssh conservative $TERM value helper plugin
|
||||
|
||||
Due to inconsistency of 256 color terminal support across
|
||||
terminal applications, it may be desirable to force the
|
||||
$TERM value to it's -256color variant.
|
||||
|
||||
For example, this is often accomplished in tmux by means
|
||||
of adding the following to a tmux.conf file:
|
||||
|
||||
set -g default-terminal "screen-256color"
|
||||
|
||||
Unfortunately, remote hosts accessed via ssh may not have
|
||||
the requisite terminfo files, and may not even allow the
|
||||
user to supply them, as is often the case with network
|
||||
equipment and other appliances accessible via ssh.
|
||||
|
||||
This helper strips the -256color suffix and exports a
|
||||
regular 'screen' or 'xterm' $TERM value when setting up
|
||||
a ssh connection.
|
||||
|
12
plugins/ssh/ssh.fish
Normal file
12
plugins/ssh/ssh.fish
Normal file
|
@ -0,0 +1,12 @@
|
|||
function ssh --description 'OpenSSH SSH client (remote login program) with a conservative $TERM value'
|
||||
switch $TERM
|
||||
case screen-256color
|
||||
set -l -x TERM screen
|
||||
command ssh $argv
|
||||
case xterm-256color
|
||||
set -l -x TERM xterm
|
||||
command ssh $argv
|
||||
case '*'
|
||||
command ssh $argv
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user