romkatv / powerlevel10k

A Zsh theme
MIT License
44.26k stars 2.12k forks source link

Two prompts appear at start #2677

Closed bakai-taalaibek closed 1 month ago

bakai-taalaibek commented 1 month ago

When I open a terminal, two prompts appear one after another:

image

The problem exists even if I fully clear the ~/.zshrc file, leaving only things that are required by powerlevel10k. If I disable powerlevel10k there is no such problem.

This problem only exists in the Tilix terminal. I couldn't reproduce it in native gnome terminal.

romkatv commented 1 month ago

Please do the following:

  1. Add this line at the very top of .zshrc:
    typeset -pm 'LINES|COLUMNS|TERM|LC_*|LANG'
  2. Restart your terminal.
  3. Run this command:
    typeset -pm 'LINES|COLUMNS|TERM|LC_*|LANG'
  4. Post a screenshot of your terminal window.
bakai-taalaibek commented 1 month ago

image

romkatv commented 1 month ago

This looks like a bug in the terminal: it reports its own horizontal size (COLUMNS) as 133 when you open it, and as 140 a little later when you run the command.

bakai-taalaibek commented 1 month ago

I actually set it as 133, because with that setting the terminal opens at full screen. Now I set columns at 140 and lines at 34, but I still get two prompts at start image

romkatv commented 1 month ago

Hm... I don't have any ideas as to what might be causing this.

bakai-taalaibek commented 1 month ago

It's a very weird bug. Check out the video. When terminal opens as a small video it has one prompt, when it is maximized it has two prompts sometimes. When you resize the window weird things happen with the prompt.

https://github.com/romkatv/powerlevel10k/assets/121804957/3d8e179a-07a4-4416-9896-6c62ec98b36a

romkatv commented 1 month ago

See https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#horrific-mess-when-resizing-terminal-window

bakai-taalaibek commented 1 month ago

Ok, thanks.

bakai-taalaibek commented 1 month ago

Is it possible to delay or disallow appearance of the right frame, right prompt and connection on startup? That would solve my problem because apparently Tilix renders the windows twice on startup: the initial rendering of a smaller window and then rendering of maximized window. So if the appearance of the right prompt is delayed it may appear only after the maximized window is rendered. Or maybe the right prompt simply shouldn't appear on startup at all.

romkatv commented 1 month ago

Powerlevel10k does not have a setting for this.

I am not sure I understand the behavior of Tilix that you are describing but it does sound like a bug in Tilix to me.

bakai-taalaibek commented 1 month ago

The default gnome terminal behaves similarly.

I think the terminal initially assumes that it is going to be opened as a small window, but then it is maximized. Because of this, the prompt is rendered twice.

romkatv commented 1 month ago

The default gnome terminal behaves similarly.

This implies that the issue must be in VTE, as both terminals are based on it.

I think the terminal initially assumes that it is going to be opened as a small window, but then it is maximized. Because of this, the prompt is rendered twice.

That would be the bug I was referring to.