-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
b$ is printed when resizing kitty #44
Comments
It seems kitty moves the cursor 1 column to the right for unknown reasons when the vertical window size is changed. ksh and mksh also seem to have trouble about the cursor position after being resized in kitty. When the window is resized, yash tries to clear and re-display the entire prompt and command line. It seems the cursor is positioned on the second column (rather than the first) of the line just after the line is cleared, which is why the first character of the prompt is left behind. The dollar sign is coming from the effect of the |
Thanks for explaining where it comes from. I looked into the kitty's issues and found a few closed issues describing problems with text and cursor position after resizing a window. I think it has something to do with the logic how kitty reflows the text after the view changes. For example here is one such issue: kovidgoyal/kitty#5635. If you look into the commit fixing this issue there is a change of "some" X coordinate in - t->x = dest_x + (t->x - src_x + 1);
+ t->x = dest_x + (t->x - src_x + (t->x > 0)); So Do you think its a kitty problem or some edge case that can be fixed in yash? |
The patch below may work, but since it is impossible for the shell to keep exact track of the cursor position moved by the terminal, especially when it is resized horizontally, it would be best that the terminal takes care of the cursor's movement. diff --git a/lineedit/display.c b/lineedit/display.c
index 0e8f938a..7a4bd20e 100644
--- a/lineedit/display.c
+++ b/lineedit/display.c
@@ -490,8 +490,11 @@ void le_display_clear(bool clear)
lebuf_print_sgr0();
if (clear)
lebuf_print_clear();
- else
+ else {
go_to((le_pos_T) { 0, 0 });
+ if (shopt_le_promptsp)
+ lebuf_print_cr();
+ }
finish();
}
} |
Yes, it works. Some terminals support additional codes for shell integration, so kitty: https://sw.kovidgoyal.net/kitty/shell-integration/. I tried to add the following sequence: lebuf_putchar('\x1b');
lebuf_putchar('\x5d');
lebuf_putchar('1');
lebuf_putchar('3');
lebuf_putchar('3');
lebuf_putchar(';');
lebuf_putchar('A');
lebuf_putchar('\x1b');
lebuf_putchar('\x5c'); at the beginning of By the way I noticed that I have this issue only if YASH_PS1R is set. It marks the position of the prompt as far as I understand. |
Something similar happens in foot. Without resizing some obsolete
But it's OK because the prompt always starts with a new line (yet, apparently without a line break). Resizing adds more Yet, when I add this line to
|
Describe the bug
kitty is a terminal emulator supporting window split and layouts (horizontal and vertical splits). When the size of a single pane is changed, a new line with
b$
is printed on another one. Interestingly this happens only if I have some input in the prompt. Kitty has integrations with some shells, but I tried the same with some other shells without integration and it doesn't seem to happen.To Reproduce
Steps to reproduce the behavior:
s
ort
).Expected behavior
Resizing works without superfluous characters being printed.
Screenshots
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: