Kovid Goyal
df4e58bc39
Improve disposal of garbage data on ssh failure
2022-03-13 15:37:46 +05:30
Kovid Goyal
2b06ca5e1a
ssh kitten: Send data without a roundtrip
...
Send data to the remote side without waiting for a data request. Avoids
an extra roundtrip during initialization.
2022-03-13 13:55:30 +05:30
Kovid Goyal
e1504c4775
Avoid needing to initialize tty state in bootstrap scripts
2022-03-13 13:55:30 +05:30
Kovid Goyal
74f0057ec8
Dont change tty state to raw
...
Just turn off echo. Makes the code much simpler, can just use shell
builtin POSIX read function.
2022-03-13 13:55:30 +05:30
Kovid Goyal
b2e74e4830
Switch to using the hostname from the CLI for settings
...
This removes the need to wait for data from the remote machine
before sending data to it.
2022-03-13 13:55:30 +05:30
Kovid Goyal
f54a3e8036
Make requesting data optional
2022-03-13 13:55:30 +05:30
Kovid Goyal
ea74add814
ssh kitten: Restore terminal state after running ssh
2022-03-12 15:48:52 +05:30
Kovid Goyal
76de99a5a8
Use a custom askpass implementation
...
Keeps OpenSSH from using the tty hopefully allowing us to start sending
data without needing to wait for the remote side to request it.
2022-03-11 16:44:08 +05:30
pagedown
740e787f54
...
2022-03-11 17:28:29 +08:00
pagedown
bd87d50948
Remove the ssh folder in cache_dir
2022-03-11 16:47:03 +08:00
pagedown
d3c0c422a5
Add user uid suffix to tmp runtime dir symlink
2022-03-11 15:42:52 +08:00
Kovid Goyal
f080871911
Update the idiotic design symlink atomically
2022-03-11 07:54:16 +05:30
Kovid Goyal
c9ef5c0715
Avoid a race in creating the idiotic_design symlink
2022-03-11 07:37:44 +05:30
Kovid Goyal
f2d6ba8775
Workaround for socket path too long on macOS
2022-03-10 22:50:26 +05:30
Kovid Goyal
f774841ee0
More robust copying of terminfo
...
Dont use symlinks in the tarball, instead create them
in the bootstrap scripts, only if needed.
2022-03-10 21:08:20 +05:30
Kovid Goyal
c23e04fd03
DRYer
2022-03-10 15:37:10 +05:30
Kovid Goyal
f67009f554
Flush the write to shm explicitly
2022-03-10 15:01:58 +05:30
Kovid Goyal
31d9db7e74
Use XDG_RUNTIME_DIR to store control master sockets
...
On Linux this has the advantage that the dir is auto cleaned on reboot
2022-03-10 12:51:21 +05:30
Kovid Goyal
384c56f834
When using control masters also enable keep alives
...
Prevents the master connection from becoming stale. Use ssh protocol
keep alives rather than tcp ones as tcp ones are often blocked by
firewalls and also spoofable.
2022-03-10 11:48:36 +05:30
Kovid Goyal
920086ae88
unlink SHM file at end of each individual test
2022-03-10 10:57:36 +05:30
Kovid Goyal
4c392426f6
Get shared memory based data transfer working
2022-03-10 10:46:04 +05:30
Kovid Goyal
20962d989f
Use POSIX shm to pass ssh data to kitty
2022-03-10 06:55:21 +05:30
Kovid Goyal
aa4d36cc57
Use secrets to generate the random password
2022-03-10 06:11:58 +05:30
Kovid Goyal
8d119f06b3
Force restrictive permissions on file used to pass ssh data to kitty
2022-03-10 05:30:47 +05:30
Kovid Goyal
708c5126b9
Return the data cookie settings when generating the bootstrap script
2022-03-09 22:18:04 +05:30
Kovid Goyal
577de9f746
ssh kitten: Start work on connection sharing
...
Basic sharing works. Now investigate if we can eliminate the round-trip
latency by transmitting the data without waiting for the start message
when using a shared connection
2022-03-09 19:27:38 +05:30
Kovid Goyal
38a70f5b51
...
2022-03-09 15:31:19 +05:30
Kovid Goyal
118306a9ff
Avoid an extra process hanging around when running the interpreter on the remote machine
2022-03-09 15:29:57 +05:30
pagedown
d29fa7b382
ssh kitten: Add FreeBSD tcsh (csh) support
...
Replace line feeds and exclamation marks for tcsh compatibility.
2022-03-09 16:11:58 +08:00
Kovid Goyal
53b1607c4d
When testing ssh kitten launch the bootscrapt script the same way sshd does it
2022-03-09 11:25:02 +05:30
Kovid Goyal
2341a27f63
...
2022-03-08 23:05:42 +05:30
Kovid Goyal
0661caf9da
DRYer
2022-03-08 23:04:58 +05:30
Kovid Goyal
5b5bd77c53
ssh kitten: Fix not working when user's login shell is fish
2022-03-08 22:39:31 +05:30
Kovid Goyal
958ebb72a6
DRYer
2022-03-08 20:48:37 +05:30
Kovid Goyal
febc5c53a6
Get the python interpreter working with non-POSIX login shells
2022-03-08 20:44:29 +05:30
Kovid Goyal
6e921300e2
Let ssh concat the cli args for us
2022-03-08 19:49:25 +05:30
Kovid Goyal
5e457da30b
Only use bz2 compression if bzip2 is available
2022-03-07 20:44:26 +05:30
Kovid Goyal
855718b179
ssh kitten: match hostnames against both remote hostname and hostname used on the command line to connect to it
2022-03-07 20:32:02 +05:30
Kovid Goyal
c9071a66ca
ssh kitten: Add an option to change the cwd at login
2022-03-07 12:24:37 +05:30
Kovid Goyal
b0ea960159
Dont use --no-same-owner when extracting tar archives
...
This flag is missing on OpenBSD and is the default on other platforms
when extracting as non-root. Make the uname/gname taringo field empty so
when extracting as root files will always be owned by root.
2022-03-07 12:10:45 +05:30
Kovid Goyal
d4d4e00f9d
Merge branch 'ksi' of https://github.com/page-down/kitty
2022-03-07 11:18:15 +05:30
Kovid Goyal
68df13d3fe
Fix recursive definitions in env vars not expanded
2022-03-07 11:07:26 +05:30
pagedown
397fbe7ad3
Avoid unnecessary which and fix typos
2022-03-07 11:30:12 +08:00
Kovid Goyal
6ff69c88df
...
2022-03-07 06:58:14 +05:30
Kovid Goyal
6e4d3c98da
Ensure pw file is cleaned up on kitten exit
...
This way it is cleaned up even if ssh fails
2022-03-07 06:54:11 +05:30
Kovid Goyal
2404eba11f
ssh kitten: Passthrough to ssh if run outside of kitty
...
Also, ensure that the ssh data request is only served if it is received
over the tty of the correct kitty window.
2022-03-07 06:48:18 +05:30
Kovid Goyal
7f9fec061a
bootstrap.py is now tested the same as bootsstrap.sh
2022-03-06 14:26:15 +05:30
Kovid Goyal
c713dc0ca8
Allow using a --kitten argument with the ssh kitten to make it easier to override settings from ssh.conf
2022-03-06 10:07:46 +05:30
Kovid Goyal
31ea5d74a7
Exclude junk directories when adding user files as well
2022-03-06 10:00:02 +05:30
Kovid Goyal
31b01d42c0
use inherited instead of inherit
2022-03-06 09:54:33 +05:30
Kovid Goyal
675411df85
Start work on python bootstrap
2022-03-05 15:43:55 +05:30
Kovid Goyal
ffa79d731c
Allow configuring the ssh kitten via env vars
2022-03-05 12:29:55 +05:30
Kovid Goyal
01dd0416ac
Add an option to control the login shell
2022-03-05 11:16:15 +05:30
Kovid Goyal
f3407959a6
Start work on python bootstrap script
2022-03-05 10:54:21 +05:30
Kovid Goyal
e797ba4800
Allow matching on hostname and username
2022-03-04 12:42:31 +05:30
Kovid Goyal
fe27ee2d79
Allow configuring the interpreter to use on the remote host
2022-03-04 12:18:27 +05:30
Kovid Goyal
e0c984046c
EXEC_CMD must come after login_shell detection since it can use login_shell
2022-03-04 10:00:12 +05:30
Kovid Goyal
f1ce8c0e8a
Add some docs for the ssh kitten
2022-03-03 22:37:24 +05:30
Kovid Goyal
7d653cb7bf
Allow copying the same file to multiple locations
2022-03-03 21:24:45 +05:30
Kovid Goyal
8867317b6a
Allow transferring files outside of HOME
2022-03-03 21:24:45 +05:30
Kovid Goyal
4b6bfaffba
More work on ssh copy
2022-03-03 21:24:45 +05:30
Kovid Goyal
e5ba15949b
$size doesnt need to be global
2022-03-03 21:24:45 +05:30
Kovid Goyal
a3e59697a1
...
2022-03-03 21:24:45 +05:30
Kovid Goyal
95da414511
Avoid one record read
2022-03-03 21:24:45 +05:30
Kovid Goyal
ae6665493a
Implement setting of env vars
2022-03-03 21:24:44 +05:30
Kovid Goyal
c6f37afeff
Add config to control shell integration per host
2022-03-03 21:24:44 +05:30
Kovid Goyal
59f656e3ca
Allow controlling where on the remote computer the ssh kitten installs its data
2022-03-03 21:24:44 +05:30
Kovid Goyal
12658c4756
Make ssh data start request transmission more robust
2022-03-03 21:24:44 +05:30
Kovid Goyal
37c185462a
Handle error messages form terminal during bootstrap
2022-03-03 21:24:44 +05:30
Kovid Goyal
02a68e7541
Pass the value of shell_integration in the tarfile
...
Allows per host overrides and also avoids needing to read kitty.conf in
the ssh kitten
2022-03-03 21:24:44 +05:30
Kovid Goyal
fda9415873
Use a record separator to delimit the start of data
...
Needed because the user could press keys and send data to the tty
before kitty can send the ssh data
2022-03-03 21:24:44 +05:30
Kovid Goyal
99d0c2d846
Get reading data working on macOS
2022-03-03 21:24:43 +05:30
Kovid Goyal
a71e7d7eb1
Simplify data transmission
2022-03-03 21:24:43 +05:30
Kovid Goyal
ddb8753548
Work on enabling shell integration over ssh
2022-03-03 21:24:43 +05:30
Kovid Goyal
e73525d0a2
Start work on testing the bootstrap script
2022-03-03 21:24:43 +05:30
Kovid Goyal
f37d947dd5
more work on ssh data transmission
2022-03-03 21:24:42 +05:30
Kovid Goyal
2dd7c3b939
More work on ssh bootstrap
2022-03-03 21:24:42 +05:30
Kovid Goyal
1e7edd0218
...
2022-02-03 20:14:52 +05:30
Kovid Goyal
2fd8ef389e
Fix use-python not working reliably with SSH kitten
2022-02-03 19:58:10 +05:30
Kovid Goyal
53589c3954
ssh kitten: Fix location of generated terminfo files on NetBSD
...
Fixes #4622
2022-02-03 19:51:37 +05:30
pagedown
4a3ed62809
Refactor: More f-string for kittens
2022-01-29 20:23:34 +08:00
pagedown
15615a4cd1
Avoid defining variables with the same name that already exist
...
Avoid using existing parameter names for local variables.
Avoid using variable names from upper level for nested loops.
Avoid local variables hiding existing global variables.
2022-01-01 21:29:32 +08:00
Kovid Goyal
6546c1da9b
run pyupgrade to upgrade the codebase to python3.6
2021-10-21 12:43:55 +05:30
Kovid Goyal
3bc7b5bad9
Remote file transfer: Fix transfer not working is custom ssh port or identity is specified on the SSH command line
...
Fixes #4067
2021-09-27 10:58:40 +05:30
Kovid Goyal
f3333ce941
Fix getting connection data from ssh command line when -- is used in the command line
...
This broke the remote file kitten when using the ssh kitten as the later
was changed to use -- recently.
Fixes #3929
2021-08-13 17:14:43 +05:30
Kovid Goyal
075fb2eaf2
DRYer
2021-07-22 17:56:21 +05:30
Kovid Goyal
21a2768ec3
...
2021-07-22 17:31:54 +05:30
Kovid Goyal
554c840d4e
ssh kitten: exit with 255 for unknown arg to match ssh
2021-07-22 17:30:07 +05:30
Kovid Goyal
9c28a1ba31
ssh kitten: handle --
2021-07-22 17:03:47 +05:30
Kovid Goyal
d8d5a8fada
More work on completion for the SSH kitten
2021-06-25 17:50:08 +05:30
Kovid Goyal
ec420b8012
Start work on completion for ssh kitten
2021-06-25 15:04:17 +05:30
Kovid Goyal
98ae2ac96a
ssh kitten: Use sh rather than /bin/sh
...
It's not actually required that sh be in /bin. The hope is that fewer
users alias sh to non POSIX things than put sh in places other than /bin
2021-06-21 16:43:59 +05:30
Kovid Goyal
1c25ed7666
ssh kitten: Fix "Connection closed" message being printed by ssh when running remote commands
...
Don't force allocate a tty when running remote commands. This
matches ssh behavior as well.
2021-06-21 16:40:07 +05:30
Kovid Goyal
fd4c7a4ed2
ssh kitten: Support system where the login shell is a non-POSIX shell
...
Now the kitten passes its script to /bin/sh and detects the login shell
using various strategies based on the value of $USER on the remote
machine. The strategies are tried one after another till one succeeds:
1) getent passwd $USER
2) id -P
3) python pwd module
4) parsing /etc/passwd
The hope is that these strategies will fail on fewer systems than
relying on the login shell being POSIX compliant.
2021-06-21 16:30:49 +05:30
Kovid Goyal
962acd1537
ssh kitten: Fix non-standard properties in terminfo such as the ones used for true color not being copied
2021-06-12 07:27:14 +05:30
Kovid Goyal
cf88eb9d60
ssh kitten: Mimic behavior of ssh more closely
...
Execute any command specified on the command line via the users' shell
on the remote side just as ssh does
Fixes #3638
2021-05-18 15:12:57 +05:30
Kovid Goyal
4e67a92ec4
DRYer
2021-01-31 12:26:54 +05:30
Kovid Goyal
e9e8ef7210
ssh kitten: Allow using python instead of the shell on the server
2021-01-31 09:04:46 +05:30
Kovid Goyal
e160cbf32b
ssh kitten: Fix parsing of combined single letter options to more closely match ssh. Fixes #3053
2020-10-23 16:55:53 +05:30
Kovid Goyal
be29c4a243
Move class definition to utils so can be used from multiple kittens easily
2020-09-15 10:34:37 +05:30