Commit Graph
82 Commits
Author SHA1 Message Date
Kovid Goyal 8f5302a650 Hook up kitty-tool completions with shell integration 2022-11-14 15:42:03 +05:30
Kovid Goyal 53dc079c10 Use compopt to manage files and spaces 2022-11-14 15:41:59 +05:30
Kovid Goyal 266e51310c Basic BASH completion 2022-11-14 15:41:59 +05:30
Mark Keisler a77852466c bash shell integration: Send STDERR of unsetting inherit_errexit to
/dev/null

Some bash versions may not have that option and rather than checking if
they even have it or if it is set, just quiet the STDERR it may throw.

```
$ kssh myhost
bash: shopt: inherit_errexit: invalid shell option name
myhost:~$ bash --version
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
```
2022-08-29 08:58:54 -05:00
Kovid Goyal 795b32efd7 Bash integration: Fix the inherit_errexit option being set by shell integration
Fixes #5349
2022-08-04 16:23:52 +05:30
pagedown 4e1cd0590b Use builtin to call read in zsh integration and bash integration 2022-07-26 13:20:50 +08:00
Kovid Goyal d6492264c7 Bash integration: Fix declare not creating global variables in .bashrc
Fixes #5254
2022-07-08 18:55:04 +05:30
Kovid Goyal fb8398c2eb bash: completion for edit/clone-in-kitty 2022-05-30 08:16:51 +05:30
Kovid Goyal e82c5a63b5 Avoid unnecessary use of cat 2022-05-27 14:18:16 +05:30
Kovid Goyal bd84ec03ce Implement edit-in-kitty for bash 2022-05-27 12:38:26 +05:30
Kovid Goyal 37cdaea9ed Also save command history before cloning in bash 2022-04-22 23:40:59 +05:30
pagedown 19fdcec358 ... 2022-04-18 11:54:14 +08:00
Kovid Goyal 230a9f4678 Implement option to control clone sourcing strategies 2022-04-17 19:39:32 +05:30
Kovid Goyal 291f9e9a5e Make cloning safer
Now env vars are set after shell rc files are sourced. And the clone
request cannot specify the cmdline to execute.
2022-04-17 07:49:58 +05:30
Kovid Goyal 1daf745d74 Add explicit support for python and conda venvs to clone-in-kitty
Still needs to be implemented for fish
2022-04-16 13:15:10 +05:30
Kovid Goyal e71b9091a3 Dont rely on env -0 for bash either 2022-04-15 13:33:32 +05:30
Kovid Goyal aab6f3e450 ... 2022-04-14 17:28:41 +05:30
Kovid Goyal 829ed0ec0d Fix #4964 2022-04-14 17:20:30 +05:30
Kovid Goyal 3ddea42660 ... 2022-04-13 22:45:36 +05:30
Kovid Goyal 1dec5f2e08 Help message for clone-in-kitty 2022-04-13 21:38:33 +05:30
Kovid Goyal 88d597f6b2 Dont define clone-in-kitty in POSIX mode
POSIX mode doesnt allow - in identifiers
2022-04-13 20:55:00 +05:30
Kovid Goyal d0c0b01724 Get clone-in-kitty working for bash as well 2022-04-13 20:38:04 +05:30
Kovid Goyal 7788f48dd5 Ensure IFS is correct when iterating over KITTY_SHELL_INTEGRATION 2022-04-12 23:03:05 +05:30
Kovid Goyal d0398dca28 Bash shell integration: Fix yet another inconsistent use of SYS_BASHRC
Why Linux distros are constitutionally incapable of using consistent
names and values for anything is beyond me.

Fixes #4934
Fixes #4935
2022-04-07 17:54:52 +05:30
Kovid Goyal 0dff455ffa declare oldval local 2022-03-30 11:57:46 +05:30
Kovid Goyal 81739288e8 handle multiple trailing spaces and semi-colons 2022-03-30 11:54:06 +05:30
Kovid Goyal 5641668bc1 Bash integration: Handle existing PROMPT_COMMAND ending with a literal newline 2022-03-30 10:44:59 +05:30
pagedown a765d551e4 Fix bash integration cwd reporting missing hostname 2022-03-23 19:29:18 +08:00
Kovid Goyal f982e754e4 Enable CWD reporting in bash integration 2022-03-15 15:37:17 +05:30
pagedown 4aea64261e ... 2022-03-07 20:56:02 +08:00
pagedown cf0cd9acd9 Remove trailing semicolons 2022-03-07 20:53:35 +08:00
pagedown b4b0bdc853 DCS @ kitty-print should be output to STDERR 2022-03-07 20:49:18 +08:00
pagedown 0b2837fcfa Fix bash integration debug log printing 2022-03-07 20:43:14 +08:00
pagedown 5f3d90e411 ... 2022-03-07 12:39:49 +08:00
pagedown 817ac82968 Detect SSH sessions without affecting performance
Exclude local runs by KITTY_PID.
Check KITTY_WINDOW_ID to detect connections via ssh kitten.
Check SSH via who -m with the integration manually installed and sudo.
2022-03-07 12:00:55 +08:00
Kovid Goyal 795953a341 get rid of the who -m ssh session test
I dont like executing a binary in a fast startup script. Lets see
if there are a lot of sessions in the wild that dont use the SSH_TTY
env var
2022-03-06 15:47:08 +05:30
Kovid Goyal f6706a55ec ... 2022-03-05 09:20:08 +05:30
Kovid Goyal e469b46ce5 Avoid calling who is either of SSH_TTY or SSH2_TTY are defined 2022-03-04 21:40:24 +05:30
Kovid Goyal 0a2b09da40 Prevent inject loop 2022-03-04 21:12:41 +05:30
Kovid Goyal c02d578468 Nicer error message if bash version < 4
macOS has bash 3
2022-03-04 20:59:22 +05:30
Kovid Goyal e990d233e5 ooops 2022-03-04 20:54:26 +05:30
Kovid Goyal a7cdcfcc16 Bash integration: Prevent shell integration code from running twice if user enables both automatic and manual integration 2022-03-04 20:48:57 +05:30
pagedown c8313409ff Explicitly call bash builtin 2022-03-04 19:36:38 +08:00
Kovid Goyal da30536709 bash/zsh integration: Show hostname in title when in an SSH session 2022-03-04 11:13:59 +05:30
Kovid Goyal 8c7ffc90f3 Fix the default bash HISTFILE changing to .sh_history instead of .bash_history
Fixes #4765
2022-02-28 20:06:48 +05:30
Kovid Goyal ef5c66ee17 Dont bother with new escape code for setting title
Since we are only sending the last command, it cannot have CSI
sequences in it anyway except in extremely contrived situations, so just
strip all ctrl chars out.
2022-02-27 10:55:02 +05:30
Kovid Goyal 33abd31d1a ... 2022-02-27 10:48:52 +05:30
Kovid Goyal 30146007d3 Avoid extra tr invocation 2022-02-27 10:23:04 +05:30
Kovid Goyal d53f8f24c4 Fix #4757
Still have to do the fix for zsh/fish
2022-02-27 10:20:19 +05:30
Kovid Goyal 27f3a5e16a Fix previous PR breaking bash integration 2022-02-23 12:30:02 +05:30