Skip to content
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

Add flag to delay shell launch until after window initialization #2817

Open
kchibisov opened this issue Sep 23, 2019 · 5 comments
Open

Add flag to delay shell launch until after window initialization #2817

kchibisov opened this issue Sep 23, 2019 · 5 comments

Comments

@kchibisov
Copy link
Member

Linux
Wayland

If you start vim with alacritty -e vim it's size will be incorrect most of the time. You can fix it with resize event though. The issue is presented on both evlp2 and master branches. Can be workaround by inserting std::thread::sleep_ms(100) in the beginning of the handle_resize.

Broken vim looks like this.

Screenshot_Mon 23 Sep 2019 04:51:49 PM MSK

@osimplex
Copy link

osimplex commented Oct 5, 2019

This behavior I can reproduce on Linux with X11.

I can also reproduce this with URxvt, using the command:
urxvt -e vim ~/.config/alacritty/alacritty.yml
The problem is less prone to occur if I do:
alacritty -e sleep 0.1 ; vim ~/.config/alacritty/alacritty.yml
Or, on URxvt:
urxvt -e sh -c "sleep 0.1 ; vim ~/.config/alacritty/alacritty.yml"

Bigger the, more prone to fail.

This problem, I think, is on Vim. The Qtile project have a reference for this kind of problem occuring on Xterm, URxvt and Rxvt.
Xterm have a flag -wf that can be used in such situation, when the program cannot handle 'inicializing' terminal state. Terminal should "wait for the window to be mapped the first time before starting the subprocess" (man xterm).

@osimplex
Copy link

osimplex commented Oct 9, 2019

Can I reproduce this bug with Neovim too. alacritty -e nvim.
A little different of Vim, Neovim is smaller than terminal window, and, as in bug report, after resize Neovim fits in terminal window and works as expected.

These programs, Vim an Neovim, expect that the terminal window will only call them after the terminal window is properly mapped.

@chrisduerr chrisduerr changed the title Incorrect pty size on startup Add flag to delay shell launch until after window initialization Nov 8, 2019
@chrisduerr
Copy link
Member

Yeah, this isn't an Alacritty bug, but instead an issue with applications running inside of Alacritty without handling size changes.

So a flag like XTerm's -wf is required.

@Chaitanyabsprip
Copy link

I am still facing this issue, any resolve?

@hisham-maged10
Copy link

hisham-maged10 commented Mar 9, 2021

hey I've found a fix for the issue, from my understanding it's an issue related to vim/neovim, it needs a certain signal to be sent from the terminal on start
adding this to your vim config file ~/.vimrc
autocmd VimEnter * :silent exec "!kill -s SIGWINCH $PPID"
fixes it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants