Weird corruption when opening new foot terminal with yash shell #195

Closed
opened 1 year ago by kqz · 3 comments
kqz commented 1 year ago

hi! I've been looking into transitioning to yash, but I'm getting this whenever I launch foot with yash set as my shell (either through login shell or specifying yash in the foot.ini)

https://streamable.com/o9659j

I'm not sure if this is a foot bug or yash bug, but I figured I'd post an issue here first since I can only reproduce this specific issue with foot, I've tried it in wayst, urxvt, st, and terminology and they can't reproduce this with those.

hi! I've been looking into transitioning to [yash](https://yash.osdn.jp/), but I'm getting this whenever I launch foot with yash set as my shell (either through login shell or specifying yash in the foot.ini) https://streamable.com/o9659j I'm not sure if this is a foot bug or yash bug, but I figured I'd post an issue here first since I can only reproduce this specific issue with foot, I've tried it in wayst, urxvt, st, and terminology and they can't reproduce this with those.
dnkl commented 1 year ago
Owner

What you're seeing is related to the window being resized, and the shell redrawing its prompt.

While not obvious, there is at least one resize happening at startup, which explains why you are seeing it right at startup.

I wasn't able to trigger this at startup, but was able to trigger it by resizing the window. I was able to do this in foot, Alacritty, Kitty and gnome-terminal. In gnome-terminal I was also able to reproduce it at startup.

Unfortunately, there isn't much we can do about this. All shells, and all terminals have this problem, more or less. I can easily trigger similar issues with e.g. zsh too, in all terminals I've tested.

It seems yash is somewhat more susceptable than other shells.

What you're seeing is related to the window being resized, and the shell redrawing its prompt. While not obvious, there _is_ at least one resize happening at startup, which explains why you are seeing it right at startup. I wasn't able to trigger this at startup, but was able to trigger it by resizing the window. I was able to do this in foot, Alacritty, Kitty and gnome-terminal. In gnome-terminal I was also able to reproduce it at startup. Unfortunately, there isn't much we can do about this. All shells, and all terminals have this problem, more or less. I can easily trigger similar issues with e.g. zsh too, in all terminals I've tested. It seems yash is somewhat more susceptable than other shells.
kqz commented 1 year ago
Poster

gotcha, that makes sense. I'll see if I can somehow mitigate this with yash then, it's weird though that I get the "$" and following corruption when I resize even if I completely unset my prompt to display nothing.

appreciate you taking a look at this though! (and thank you for foot, it's awesome!)

i'll go ahead and close this now.

quick update for anyone else seeing this with yash

dug around in the source, this is the culprit

/* Prints a dummy string that moves the cursor to the first column of the next
 * line if the cursor is not at the first column.
 * This function does nothing if the "le-promptsp" option is not set. */
void maybe_print_promptsp(void)
{
    if (shopt_le_promptsp) {
	lebuf_print_smso();
	lebuf_putchar('$');
	lebuf_print_sgr0();
	for (int count = le_columns - (le_ti_xenl ? 1 : 2); --count >= 0; )
	    lebuf_putchar(' ');
	lebuf_print_cr();
	lebuf_print_ed();
    }
}

so a quick workaround is to just add ++le-promptsp to your .yashrc

gotcha, that makes sense. I'll see if I can somehow mitigate this with yash then, it's weird though that I get the "$" and following corruption when I resize even if I completely unset my prompt to display nothing. appreciate you taking a look at this though! (and thank you for foot, it's awesome!) i'll go ahead and close this now. quick update for anyone else seeing this with yash dug around in the source, this is the culprit ``` /* Prints a dummy string that moves the cursor to the first column of the next * line if the cursor is not at the first column. * This function does nothing if the "le-promptsp" option is not set. */ void maybe_print_promptsp(void) { if (shopt_le_promptsp) { lebuf_print_smso(); lebuf_putchar('$'); lebuf_print_sgr0(); for (int count = le_columns - (le_ti_xenl ? 1 : 2); --count >= 0; ) lebuf_putchar(' '); lebuf_print_cr(); lebuf_print_ed(); } } ``` so a quick workaround is to just add `++le-promptsp` to your .yashrc
kqz closed this issue 1 year ago
dnkl commented 1 year ago
Owner

and thank you for foot, it’s awesome!

Thanks ❤️

so a quick workaround is to just add ++le-promptsp to your .yashrc

Thank you for this!

> and thank you for foot, it’s awesome! Thanks ❤️ > so a quick workaround is to just add ++le-promptsp to your .yashrc Thank you for this!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.