-
Notifications
You must be signed in to change notification settings - Fork 4
/
USAGE.txt
62 lines (46 loc) · 2.57 KB
/
USAGE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
To use, you simply replace "ssh" command with "sshlm".
It passes all its parameters to ssh unmodified.
By default, sshlm starts in char-by-char mode so everything is the same as
when using regular ssh. However, when you press "ctrl-]" hotkey, local line
editing mode pops up (indicated by underlined "[L]"), where you can use all
GNU Readline functionality (command recall, command line editing etc).
When in local-line-editing mode, "enter" (or "ctrl-]") will send all inputted
data to remote shell and return to char-by-char mode.
Another option (instead of manually entering local-line-editing mode all the
time with hotkey, which quickly gets boring) is automatic shell prompt
detection.
If your shell prompts ends in "-lm% " or "-lm# " or "-lm> " or "-lm$ "
(see $REMOTE_PS1_RE in sshlm), then local-line-editing mode will be enabled
automatically (until you exit it by pressing "enter" or "ctrl-]" hotkey)
So, to enable, upon logging in on remote host, change your prompt with
(for example):
PS1="myremotehost-lm> "
and it should automatically detect and enable local-line-editing mode
(indicated by "[L]").
If you set your local environment variable SSHLM_AUTO=1 before running
sshlm (like "SSHLM_AUTO=1; export SSHLM_AUTO"), sshlm will try to autodetect
ANY remote prompt upon connection, and setup new PS1 automatically, so you
are immediately put in local line mode when you connect to remote host.
If you want to remove non-ASCII underline (ornaments) around "[L]" prompt,
execute this in your shell:
PERL_RL="Gnu o=0"; export PERL_RL
REQUIREMENTS:
- sshlm wrapper is written in perl, and requires several perl modules.
(Term::ReadLine IO::Pty::Easy Term::ReadKey)
Modules can be installed manually from http://cpan.org/ or in Debian-based distributions by:
"apt-get install libterm-readline-gnu-perl libio-pty-easy-perl libterm-readkey-perl"
It also requires any command-line ssh client of your choice (like openssh-client).
INSTALLATION:
- "sudo make install" (or "make deb" to build Debian package)
BUGS & WORKAROUNDS:
- <tab> key will not do what you want (remote filename completion).
This is very hard (if not impossible) to do properly.
Instead, it will do LOCAL filename completion by default.
Alternatively, if you want <tab> to finish the local line editing,
fallback to char-by-char mode and send local input so far (including tab)
for processing to remote side, put following lines in your ~/.inputrc
(quotes and all):
$if sshlm
"\C-i": sshlm-accept-line-immed
$endif
- see BUGS.txt for other known anomalies and improvement ideas (to be fixed someday hopefully)