Programmatically editing buffer breaks backspace and arrow keys #5263
Replies: 2 comments
-
Some thoughts.
If your common approach is working for ptk with pure python but not working in xonsh and you have strong spirit it will be cool to improve xonsh because of many issues around using completers like fzf. (My messages has "Maintainer" label but the "maintainer" is the team of volunteers during a couple of years. Don't treat my comment as a comment from "owner".) |
Beta Was this translation helpful? Give feedback.
-
Thanks! Your suggestion about Previously I was running the command via
Edit: Scratch all that! I just discovered |
Beta Was this translation helpful? Give feedback.
-
I'm trying to integrate atuin with xonsh. Right now I'm working on the actual search operation itself, which has two parts:
atuin
, which is a interactive TUI, andMy problem is with step 2. I've got access to the buffer via methods similar to what's detailed on this page, i.e. in my handler it's accessible as
event.current_buffer
. The problem is that when I edit the contents of the buffer, either by assigning directly tobuffer.text
or callingbuffer.set_document
(orbuffer.apply_completion
) it ends up in a weird broken state where I can type to add new text to the buffer, but I can't erase the text that I added programmatically. Navigating around with arrow keys is also broken and just results in spewing^[[D
and the like to stdout.What's going on here? How can I restore the buffer to a properly-editable state?
For reference, here's a simplified version of my code:
Beta Was this translation helpful? Give feedback.
All reactions