Hi! I use xonsh as my primary shell and kitty as my terminal.
Kitty 0.2.4 adds new Shell Integration, which includes a ton of awesome features 😄 🚀
Amazing features
1. Open the output of the last command in a pager such as less (ctrl+shift+g)
2. Jump to the previous/next prompt in the scrollback (ctrl+shift+z / ctrl+shift+x)
3. Click with the mouse anywhere in the current command to move the cursor there
4. Hold ctrl+shift and right-click on any command output in the scrollback to view it in a pager
5. The current working directory or the command being executed are automatically displayed in the kitty window titlebar/tab title.
6. The text cursor is changed to a bar when editing commands at the shell prompt
7. Glitch free window resizing even with complex prompts. Achieved by erasing the prompt on resize and allowing the shell to redraw it cleanly.
8. Sophisticated completion for the kitty command in the shell.
9. When confirming a quit command if a window is sitting at a shell prompt, it is optionally, not counted (see confirm_os_window_close)
It looks like the shell's core would only need to add three hooks.
config
config
```
| xonsh | 0.11.0 |
| Git SHA | 337cf25 |
| Commit Date | Nov 17 15:37:41 2021 |
| Python | 3.9.9 |
| PLY | 3.11 |
| have readline | True |
| prompt toolkit | 3.0.23 |
| shell type | prompt_toolkit |
| history backend | sqlite |
| pygments | None |
| on posix | True |
| on linux | False |
| on darwin | True |
| on windows | False |
| on cygwin | False |
| on msys2 | False |
| is superuser | False |
| default encoding | utf-8 |
| xonsh encoding | utf-8 |
| encoding errors | surrogateescape |
| on jupyter | False |
| jupyter kernel | None |
| xontrib 1 | back2dir |
| xontrib 2 | jedi |
| xontrib 3 | readable-traceback |
| RC file 1 | /Users/nicholas/.xonshrc |
+------------------+--------------------------+
```
Expected Behavior
First-class integration with kitty. I propose adding it as a built-in xontrib.
Here is a link to an explanation on how it works.
The actual shell integration code uses hooks provided by each shell to send special escape codes to kitty, to perform the various tasks.
Here's a link to the code for the builtin supported shells
It looks like the hooks required directly from the shell side are pretty simple (just a couple of escape codes).
From the Notes for Shell Developers:
The protocol used for marking the prompt is very simple. You should consider adding it to your shell as a builtin. Many modern terminals make use of it, for example: kitty, iTerm2, WezTerm, DomTerm
- Just before starting to draw the PS1 prompt send the escape code:
<OSC>133;A<ST>
- Just before starting to draw the PS2 prompt send the escape code:
<OSC>133;A;k=s<ST>
- Just before running a command/program, send the escape code: 133;C
Proposal
Due to the increasing popularity of kitty (13.2k stars), I propose adding kitty integration as a builtin xontrib.
I don't really have the proper experience with xonsh internals to put those three hooks in place (or know if they're already there).
However, once the hooks are in place, I would be happy to port the bulk of the integration and maintain it as a builtin xontrib 😄
Current Behavior (and existing integration)
There is an existing kitty xontrib, but it's extremely barebones and does not support these new features. It has not been updated since 2019
It really only adds a couple of aliases and enables fancy matplotlib integration.
I
To be clear, I'm not proposing we add the matplotlib, only port the "official" integration from zsh/fish.
Also I highly doubt kitty will add support for xonsh on their end. I think we're considered somewhat of a niche community 😦
For community
⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment
Hi! I use xonsh as my primary shell and kitty as my terminal.
Kitty 0.2.4 adds new Shell Integration, which includes a ton of awesome features 😄 🚀
Amazing features
1. Open the output of the last command in a pager such as less (ctrl+shift+g) 2. Jump to the previous/next prompt in the scrollback (ctrl+shift+z / ctrl+shift+x) 3. Click with the mouse anywhere in the current command to move the cursor there 4. Hold ctrl+shift and right-click on any command output in the scrollback to view it in a pager 5. The current working directory or the command being executed are automatically displayed in the kitty window titlebar/tab title. 6. The text cursor is changed to a bar when editing commands at the shell prompt 7. Glitch free window resizing even with complex prompts. Achieved by erasing the prompt on resize and allowing the shell to redraw it cleanly. 8. Sophisticated completion for the kitty command in the shell. 9. When confirming a quit command if a window is sitting at a shell prompt, it is optionally, not counted (see confirm_os_window_close)It looks like the shell's core would only need to add three hooks.
config
config
``` | xonsh | 0.11.0 | | Git SHA | 337cf25 | | Commit Date | Nov 17 15:37:41 2021 | | Python | 3.9.9 | | PLY | 3.11 | | have readline | True | | prompt toolkit | 3.0.23 | | shell type | prompt_toolkit | | history backend | sqlite | | pygments | None | | on posix | True | | on linux | False | | on darwin | True | | on windows | False | | on cygwin | False | | on msys2 | False | | is superuser | False | | default encoding | utf-8 | | xonsh encoding | utf-8 | | encoding errors | surrogateescape | | on jupyter | False | | jupyter kernel | None | | xontrib 1 | back2dir | | xontrib 2 | jedi | | xontrib 3 | readable-traceback | | RC file 1 | /Users/nicholas/.xonshrc | +------------------+--------------------------+ ```Expected Behavior
First-class integration with kitty. I propose adding it as a built-in xontrib.
Here is a link to an explanation on how it works.
Here's a link to the code for the builtin supported shells
It looks like the hooks required directly from the shell side are pretty simple (just a couple of escape codes).
From the Notes for Shell Developers:
Proposal
Due to the increasing popularity of kitty (13.2k stars), I propose adding kitty integration as a builtin xontrib.
I don't really have the proper experience with xonsh internals to put those three hooks in place (or know if they're already there).
However, once the hooks are in place, I would be happy to port the bulk of the integration and maintain it as a builtin xontrib 😄
Current Behavior (and existing integration)
There is an existing
kittyxontrib, but it's extremely barebones and does not support these new features. It has not been updated since 2019It really only adds a couple of aliases and enables fancy matplotlib integration.
I
To be clear, I'm not proposing we add the matplotlib, only port the "official" integration from zsh/fish.
Also I highly doubt kitty will add support for xonsh on their end. I think we're considered somewhat of a niche community 😦
For community
⬇️ Please click the 👍 reaction instead of leaving a
+1or 👍 comment