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

Term spawning with multiple lines #1543

Closed
opened 2023年11月06日 06:00:07 +01:00 by Rohan · 9 comments

I been having this bug with foot when i spawn a new terminal everytime it occours

I been having this bug with foot when i spawn a new terminal everytime it occours
Collaborator
Copy link
  • How are you spawning the terminal?
  • Which shell are you using?
  • Does it still happen if you run foot and/or the shell with the default config? (e.g. foot -c /dev/null bash --noprofile --rcfile /etc/profile)
- How are you spawning the terminal? - Which shell are you using? - Does it still happen if you run foot and/or the shell with the default config? (e.g. `foot -c /dev/null bash --noprofile --rcfile /etc/profile`)
Owner
Copy link

Guessing this is yet another duplicate of #195

Guessing this is yet another duplicate of https://codeberg.org/dnkl/foot/issues/195
Author
Copy link

@craigbarnes I'm using sway with bindsym $mod+Return exec foot, and i'm using ash from busybox. When i run foot -c /dev/null ash --noprofile --rcfile /etc/profile i get this output.

warn: config.c:3563: Arimo: font does not appear to be monospace; check your config, or disable this warning by setting [tweak].font-monospace-warn=no
warn: wayland.c:1509: fractional scaling not available
warn: wayland.c:1512: no server-side cursors available, falling back to client-side cursors

The font warning is normal i just changed it to the correct font but with or whitout this change i still get this problem

@craigbarnes I'm using sway with `bindsym $mod+Return exec foot`, and i'm using ash from busybox. When i run `foot -c /dev/null ash --noprofile --rcfile /etc/profile` i get this output. ``` warn: config.c:3563: Arimo: font does not appear to be monospace; check your config, or disable this warning by setting [tweak].font-monospace-warn=no warn: wayland.c:1509: fractional scaling not available warn: wayland.c:1512: no server-side cursors available, falling back to client-side cursors ``` The font warning is normal i just changed it to the correct font but with or whitout this change i still get this problem
Collaborator
Copy link

I'd forgotten that the issue mentioned in #195 (and #453) has been known to cause this type of prompt behavior before, but @dnkl's suspicion about that seems to be correct. I can reproduce the same behavior as you observed if I run:

foot busybox ash

...whereas the prompt works as expected if I run either of the following:

foot sh -c 'sleep 0.1; busybox ash'
# Less added latency vs. using sleep; see https://codeberg.org/craigbarnes/waitwinch
foot waitwinch busybox ash

Or in other words, this is a duplicate of several previous issues and the solution is being tracked in #453.

I'd forgotten that the issue mentioned in #195 (and #453) has been known to cause this type of prompt behavior before, but @dnkl's suspicion about that seems to be correct. I can reproduce the same behavior as you observed if I run: ```sh foot busybox ash ``` ...whereas the prompt works as expected if I run either of the following: ```sh foot sh -c 'sleep 0.1; busybox ash' # Less added latency vs. using sleep; see https://codeberg.org/craigbarnes/waitwinch foot waitwinch busybox ash ``` Or in other words, this is a duplicate of several previous issues and the solution is being tracked in #453.
craigbarnes 2023年11月06日 20:14:28 +01:00
  • closed this issue
  • added the
    duplicate
    label
Collaborator
Copy link

@dnkl mentioned the following point in #453:

... my guess is applications that exhibit sizing issues (like described in #723) are racy, and request the initial size before registering their SIGWINCH handler.

...which appears to be the case for busybox ash:

# Press Ctrl+D after the interactive shell starts
strace -o ash-trace.txt busybox ash; grep -E 'TIOCGWINSZ|SIGWINCH' ash-trace.txt
ioctl(0, TIOCGWINSZ, {ws_row=47, ws_col=191, ws_xpixel=1910, ws_ypixel=987}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=47, ws_col=191, ws_xpixel=1910, ws_ypixel=987}) = 0
ioctl(1, TIOCGWINSZ, 0x7ffd1ce14df0) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(0, TIOCGWINSZ, {ws_row=47, ws_col=191, ws_xpixel=1910, ws_ypixel=987}) = 0
rt_sigaction(SIGWINCH, {sa_handler=0x4b6a1f, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x4d5bdb}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGWINCH, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x4d5bdb}, NULL, 8) = 0

...or in other words, this specific issue could probably be avoided if ash set up its SIGWINCH handler before requesting the initial terminal size.

@dnkl [mentioned](https://codeberg.org/dnkl/foot/issues/453#issuecomment-266314) the following point in #453: > ... my guess is applications that exhibit sizing issues (like described in #723) are racy, and request the initial size before registering their SIGWINCH handler. ...which appears to be the case for `busybox ash`: ```sh # Press Ctrl+D after the interactive shell starts strace -o ash-trace.txt busybox ash; grep -E 'TIOCGWINSZ|SIGWINCH' ash-trace.txt ``` ``` ioctl(0, TIOCGWINSZ, {ws_row=47, ws_col=191, ws_xpixel=1910, ws_ypixel=987}) = 0 ioctl(1, TIOCGWINSZ, {ws_row=47, ws_col=191, ws_xpixel=1910, ws_ypixel=987}) = 0 ioctl(1, TIOCGWINSZ, 0x7ffd1ce14df0) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(0, TIOCGWINSZ, {ws_row=47, ws_col=191, ws_xpixel=1910, ws_ypixel=987}) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x4b6a1f, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x4d5bdb}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x4d5bdb}, NULL, 8) = 0 ``` ...or in other words, this specific issue could probably be avoided if `ash` set up its SIGWINCH handler *before* requesting the initial terminal size.
Author
Copy link

@craigbarnes your solution for time waiting just work for the new term that are spawned, the previous term still get a new line everytime i spawn a new terminal.

@craigbarnes your solution for time waiting just work for the new term that are spawned, the previous term still get a new line everytime i spawn a new terminal.
Collaborator
Copy link

It's not clear what distinction you're making. What do you mean by "the previous term"?

If you're still spawning foot via bindsym $mod+Return exec foot, you'll continue to see the same problem, for the reasons outlined above (and described in #453).

It's not clear what distinction you're making. What do you mean by "the previous term"? If you're still spawning foot via `bindsym $mod+Return exec foot`, you'll continue to see the same problem, for the reasons outlined above (and described in #453).
Author
Copy link

@craigbarnes if you see the image i sended you can see that every terminal is like one more line than the previous, that's what i mean. Try to exec a new term and you see that the last term get a new break line a "enter command". You can see again in this image

@craigbarnes if you see the image i sended you can see that every terminal is like one more line than the previous, that's what i mean. Try to exec a new term and you see that the last term get a new break line a "enter command". You can see again in this [image](https://0x0.st/HtOu.png)
Collaborator
Copy link

Try to exec a new term ...

Do you mean with Ctrl+Shift+N? If so, that just launches your default shell, presumably without the sleep workaround. When I mentioned the example of running:

foot sh -c 'sleep 0.1; busybox ash'

...it was just for demonstration purposes, to highlight that the bug is in ash (and/or sway) and not foot. If you want to use that same workaround for terminals spawned via Ctrl+Shift+N you need to add something like the following to ~/.config/foot/foot.ini:

shell = sh -c 'sleep 0.1; exec busybox ash'

Note that this is just an example workaround and not necessarily a suggestion. My suggestion would be to use a different shell.

> Try to exec a new term ... Do you mean with Ctrl+Shift+N? If so, that just launches your [default shell](https://codeberg.org/dnkl/foot/src/branch/master/doc/foot.ini.5.scd#L36-L40), presumably *without* the `sleep` workaround. When I mentioned the example of running: ```sh foot sh -c 'sleep 0.1; busybox ash' ```` ...it was just for demonstration purposes, to highlight that the bug is in `ash` (and/or `sway`) and not foot. If you want to use that same workaround for terminals spawned via Ctrl+Shift+N you need to add something like the following to `~/.config/foot/foot.ini`: ```ini shell = sh -c 'sleep 0.1; exec busybox ash' ``` Note that this is just an *example* workaround and **not** necessarily a suggestion. My suggestion would be to use a different shell.
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#1543
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?