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

Prompt becomes invisible after surface resize. #2214

Open
LordMZTE opened this issue Sep 10, 2024 · 10 comments
Open

Prompt becomes invisible after surface resize. #2214

LordMZTE opened this issue Sep 10, 2024 · 10 comments

Comments

@LordMZTE
Copy link
Collaborator

Description

When a surface is resized, the currently active prompt, presumably as indicate to Ghostty via OSC133 becomes invisible. This state is reverted once something is typed in that surface again.

To reproduce

  1. Create a surface and enter some text:
    screenshot
  2. Resize the surface, in my case, I'll create a vertical split to the right to achieve this. Now, the currently "active" prompt only will no longer render:
    screenshot
  3. Type something into the surface. The prompt will show again:
    screenshot

System information

OS: NixOS Vicuna / nixpkgs revision 28e9b6d60ffd048dbbfbce525f8ab5bd726a22c3
Ghostty version: commit 67abd88 built via the nix flake with the nixpkgs input set to follow the above version
Apprt: GTK
Shell: Nushell (ships its own OSC133 support)

@mitchellh
Copy link
Contributor

I'll have to review the logic but I want to note that this is expected (we can still have a bug in the details of the logic of course). Certain OSC133 sequences imply the shell will redraw the prompt line on resize, so Ghostty clears it out. Fish is a good example of this working (the shell integration sets it up). I believe Kitty also clears out the line perhaps their logic is different such that Nushell is ignored.

Like I said, its been a long long time since I looked at this part of the code so I'll have to review.

@LordMZTE
Copy link
Collaborator Author

Thank you! It's very possible that this is an issue on the Nushell side. Let me know if I should open an issue there.

@tristan957
Copy link
Collaborator

tristan957 commented Sep 12, 2024

FWIW I've seen a similar behavior on bash too. Hard for me to confirm it's the same, since I find the behavior I experience hard to reproduce.

@jparise
Copy link
Collaborator

jparise commented Sep 12, 2024

See also #1961

@NicolasGB
Copy link

Having the same issue. I'm also using nushell un a multiline prompt.

I can reliably reproduce it when creating a new tab, which means resizing.

Here's a small video, let me know if I can provide any more information.

Prompt.disappearing.mp4

@milomg
Copy link

milomg commented Jan 3, 2025

Related: nushell/reedline#684 (this is somewhat improved in nushell 101)

@LordMZTE
Copy link
Collaborator Author

LordMZTE commented Jan 3, 2025

Testing this again - I noticed that this issue no longer occurs with nushell 101. The prompt briefly becomes invisible during the resize, but then reappears. I'll still leave this open to track that, though.

@jparise
Copy link
Collaborator

jparise commented Jan 3, 2025

FWIW I've seen a similar behavior on bash too. Hard for me to confirm it's the same, since I find the behavior I experience hard to reproduce.

I've also seen this in bash -- most consistently in macOS debug builds, presumably because they run "slower". That implies there could be a (thread?) timing-related element in play.

@trolljoe
Copy link

Image

can confirm i'm having the same issue with nushell and starship as my prompt. i'm on latest nushell so idk what could be causing this

@milomg
Copy link

milomg commented Jan 13, 2025

Note that the flickering with nushell is caused by automatic batching https://github.com/nushell/reedline/blob/1800dcd362ae59e9b960d7a860cb47281f880a5f/src/engine.rs#L755-L761 (commenting these lines out will speed up the repainting and almost remove the flicker). Maybe this issue should be closed in favor of an issue on nushell/reedline?

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

No branches or pull requests

7 participants