Skip to content

Fix async prompt input lag on WSL by detaching background workers from stdin#646

Open
LeonRein wants to merge 1 commit intoIlanCosman:mainfrom
LeonRein:dev
Open

Fix async prompt input lag on WSL by detaching background workers from stdin#646
LeonRein wants to merge 1 commit intoIlanCosman:mainfrom
LeonRein:dev

Conversation

@LeonRein
Copy link
Copy Markdown

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/null to all background prompt worker launches in fish_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:

  • WSL2
  • large git repo on /mnt/c
  • repeatedly cd into repo and type immediately while git segment is still loading

Before this change, typing felt laggy and some keys were missed.
After this change, prompt interaction stayed smooth while git status loaded in the background.

  • I have tested using Linux.
  • I have tested using MacOS.

Checklist

  • I am ready to update the wiki accordingly.
  • I have updated the tests accordingly.

Copilot AI review requested due to automatic review settings March 23, 2026 08:14
@LeonRein LeonRein requested a review from IlanCosman as a code owner March 23, 2026 08:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/null for each background $fish_path -c ... & prompt worker invocation in fish_prompt.fish.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async git status blocks keyboard input on WSL

2 participants