Fix async prompt input lag on WSL by detaching background workers from stdin#646
Open
LeonRein wants to merge 1 commit intoIlanCosman:mainfrom
Open
Fix async prompt input lag on WSL by detaching background workers from stdin#646LeonRein wants to merge 1 commit intoIlanCosman:mainfrom
LeonRein wants to merge 1 commit intoIlanCosman:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a WSL-specific usability issue where Tide’s async prompt workers appear to interfere with interactive input while slow segments (notably git status on /mnt/c) are still computing, by detaching those background workers from stdin.
Changes:
- Redirect stdin from
/dev/nullfor each background$fish_path -c ... &prompt worker invocation infish_prompt.fish.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I ran into an issue on WSL where Tide becomes hard to use while async git status is still loading. During that time, some keystrokes seem to get lost or delayed, and then everything goes back to normal as soon as git info appears.
This change adds
</dev/nullto all background prompt worker launches infish_prompt.fish, so those async worker processes are fully detached from stdin.I want to be transparent: I’m not 100% sure about the exact low-level reason this fixes it, but in my case it consistently solved the problem.
Motivation and Context
The problem was especially visible in large repos on WSL2 (
/mnt/c/...) where git status takes several seconds. The whole point of async prompt rendering is to keep the shell responsive during that time, and that wasn’t happening for me.I originally found this issue (and this possible fix) with AI assistance, so this PR should definitely be reviewed by someone who knows this part of Tide/fish internals better before merging.
Closes #643
Screenshots (if appropriate)
N/A
How Has This Been Tested
I tested manually on my setup:
/mnt/ccdinto repo and type immediately while git segment is still loadingBefore this change, typing felt laggy and some keys were missed.
After this change, prompt interaction stayed smooth while git status loaded in the background.
Checklist