pagedown
0d116e6ef0
Use four spaces to indent
2022-08-08 22:31:55 +05:30
Kovid Goyal
97d7329d14
A nicer fix for kitty @ ls | less
...
We rely on the fact that cfmakeraw() and less's code to put the tty in
raw state diverge. This is obv a hack but then so is kitty @ ls | less
This hack allows
kitty +kitten clipboard --get-clipboard > output
to work.
2022-08-02 18:33:53 +05:30
Kovid Goyal
609d42e2bc
Ignore EAGAIN when doing tty io
2022-08-02 17:21:28 +05:30
Kovid Goyal
f637bf2377
socket prewarm: Dont control the tty if STDOUT is not a tty
...
This is because we could be being piped to a program like less that does
want to control the tty itself
2022-08-02 14:09:34 +05:30
Kovid Goyal
a5cbb552f0
Allow prewarming of kitty @ commands
2022-08-01 19:47:28 +05:30
Kovid Goyal
e43ca5b031
Add an implementation using splice() for in-kernel tty copies
...
Sadly splice is currently not functional in Linux, so the implementation
is turned off
2022-08-01 19:16:51 +05:30
Kovid Goyal
cc7e668ad6
Cleanup editing of proc environ
2022-08-01 19:03:03 +05:30
Kovid Goyal
e0ce0a67cc
ensure setting KITTY_PREWARM_SOCKET_REAL_TTY does not clobber the environ
2022-08-01 19:03:03 +05:30
Kovid Goyal
0d83a8866b
Make setting the real tty name more robust
2022-08-01 19:03:03 +05:30
Kovid Goyal
f7a7e39a36
prewarm wrapper should indicate it is active via the process environment
2022-08-01 19:03:03 +05:30
Kovid Goyal
67cb466ea9
...
2022-08-01 19:03:03 +05:30
Kovid Goyal
8668087d15
flush data when exiting on signal as well
...
should make the signal tests less flaky
2022-08-01 19:03:03 +05:30
Kovid Goyal
dda28efd66
Use the same signal to stop as stopped the child
2022-08-01 19:03:02 +05:30
Kovid Goyal
fc06196a3e
Restore termios state when stopping
2022-08-01 19:03:02 +05:30
Kovid Goyal
2a1809a2d8
When exiting with a signal run cleanup
2022-08-01 19:03:02 +05:30
Kovid Goyal
ac5c312267
Work on handling child stop events
2022-08-01 19:03:02 +05:30
Kovid Goyal
fd6231a778
Fix signal reading in prewarm wrapper
2022-08-01 19:03:01 +05:30
Kovid Goyal
624e96df9b
wrapper process should exit with signal if prewarmed worker exits with signal
2022-08-01 19:03:01 +05:30
Kovid Goyal
f96a13e9e4
mask handled signals when running signal handler
2022-08-01 19:03:01 +05:30
Kovid Goyal
7b70ed96b6
DRYer
2022-08-01 19:03:01 +05:30
Kovid Goyal
9379853d47
Get the SIGINT test working on macOS
2022-08-01 19:03:01 +05:30
Kovid Goyal
45186a17ca
macOS doesnt allow TIOCSWINSZ from any process other than the process connected to the terminal or its parent
...
So send it over the socket to the zygote and have it resize the
terminal. Sigh.
2022-08-01 19:03:00 +05:30
Kovid Goyal
6114b49630
Ensure pty is in utf8
2022-08-01 19:03:00 +05:30
Kovid Goyal
87d95caae0
Dont bother sending slave fd over the socket as it doesnt help on macOS anyway
2022-08-01 19:03:00 +05:30
Kovid Goyal
6cec89181b
dont abort when failing to write to a tty
2022-08-01 19:03:00 +05:30
Kovid Goyal
c9b14f6f78
Switch to using select() instead of poll() in prewarm wrapper
...
This is because poll() is broken on macOS with pty fds
2022-08-01 19:03:00 +05:30
Kovid Goyal
991fbacb99
Fix ttyfd passing
2022-08-01 19:03:00 +05:30
Kovid Goyal
72f3e8cd40
Avoid passing around pty paths, instead send the pty fd
2022-08-01 19:03:00 +05:30
Kovid Goyal
cf8113ea24
Even more flexible management of poll data
2022-08-01 19:03:00 +05:30
Kovid Goyal
5d1cf49fb6
Only set control msg metadata when actually sending a control msg
2022-08-01 19:03:00 +05:30
Kovid Goyal
1991f1ccd7
Better handling of multiple optional to poll fds
2022-08-01 19:02:59 +05:30
Kovid Goyal
8fad8972d5
...
2022-08-01 19:02:59 +05:30
Kovid Goyal
fc3e78e226
Also handle SIGQUIT
2022-08-01 19:02:59 +05:30
Kovid Goyal
7e26a340a3
Try to read from child pty even after zygote signals its death
2022-08-01 19:02:59 +05:30
Kovid Goyal
f0764c24d2
Retry read/write while there is space
2022-08-01 19:02:59 +05:30
Kovid Goyal
d080bf3b9c
Forward termination signals
2022-08-01 19:02:59 +05:30
Kovid Goyal
92bbf08343
Fix socket connect call on non-linux
2022-08-01 19:02:59 +05:30
Kovid Goyal
ef3e9d1c2e
make various compilers happy
2022-08-01 19:02:58 +05:30
Kovid Goyal
09ddbbf600
Finish move of prewarm launcher into its own compilation unit
2022-08-01 19:02:58 +05:30
Kovid Goyal
4195c239c8
Start moving prewarm launcher into its own compilation unit
2022-08-01 19:02:58 +05:30