dnkl/foot
41
2.0k
Fork
You've already forked foot
243

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

Closed
opened 2020年11月11日 03:32:27 +01:00 by kqz · 4 comments

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.
Owner
Copy link

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.
Author
Copy link

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
Owner
Copy link

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!

For anyone reading this issue now, the new syntax for the fix is is set +o lepromptsp

For anyone reading this issue now, the new syntax for the fix is is `set +o lepromptsp`
Sign in to join this conversation.
No Branch/Tag specified
master
osc-5522
sixel-heap-buffer-overflow
releases/1.27
releases/1.26
releases/1.25
releases/1.24
multi-cursor
releases/1.23
pixman-16f-2
releases/1.22
releases/1.21
releases/1.20
releases/1.19
releases/1.18
releases/1.17
releases/1.16
releases/1.15
releases/1.14
releases/1.13
releases/1.12
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.27.0
1.26.1
1.26.0
1.25.0
1.24.0
1.23.1
1.23.0
1.22.3
1.22.2
1.22.1
1.22.0
1.21.0
1.20.2
1.20.1
1.20.0
1.19.0
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.3
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.3
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot#195
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?