Mark/detect shell prompt lines #3812
Replies: 1 comment
-
On Thu, Jul 08, 2021 at 08:55:45AM -0700, Jason Felice wrote:
I just realized this has another benefit: Since I'm using my editor as my scrollback pager, I can map keys to jump to the previous/next prompt.
If you want your editor to work or this there's no way you can mark it
invisibly, you would need to use a special character, just pick
something from the unicode symbols list as your prompt char.
And if you want to jump to it in kitty, use the kitty marks feature:
https://sw.kovidgoyal.net/kitty/marks.html
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
eraserhd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Long time kitty user now, and it's awesome!
I want to somehow (preferably invisibly) mark where the shell prompts are so that I can send just the output of the last command to my editor. There are different use cases, but an after-the-fact quickfix is the most useful one.
IIRC, iTerm2 has this by sending an escape code in the shell prompt.
I could set up a regex to look for my prompt and change my prompt to have some character unlikely to occur naturally, but I'm curious if there's a better way.
EDIT: I just realized this has another benefit: Since I'm using my editor as my scrollback pager, I can map keys to jump to the previous/next prompt.
Beta Was this translation helpful? Give feedback.
All reactions