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

Flushing FTCS sequences causes flickering in nushell (again; 1.20+) #16769

Closed
lhecker opened this issue Feb 26, 2024 · 7 comments · Fixed by #16793
Closed

Flushing FTCS sequences causes flickering in nushell (again; 1.20+) #16769

lhecker opened this issue Feb 26, 2024 · 7 comments · Fixed by #16793
Assignees
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conpty For console issues specifically related to conpty Product-Terminal The new Windows Terminal.

Comments

@lhecker
Copy link
Member

lhecker commented Feb 26, 2024

Windows Terminal version

1.20.10572.0

Steps to reproduce

  • Install nushell
  • Open $nu.config-path in your favorite editor
  • Find shell_integration and set it to true

Expected Behavior

No flickering, as it was the case between 1.18 and 1.19.

Actual Behavior

The prompt line flickers:

596kHbpNFuSdsCC3

See #13710 for the previous issue.

@lhecker lhecker added Product-Conpty For console issues specifically related to conpty Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Feb 26, 2024
@lhecker lhecker added this to the Terminal v1.21 milestone Feb 26, 2024
@lhecker lhecker self-assigned this Feb 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 26, 2024

This comment was marked as off-topic.

@carlos-zamora carlos-zamora removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 28, 2024
@rgwood
Copy link

rgwood commented Feb 29, 2024

I am able to reproduce it in 1.19.10573.0 even without AtlasEngine enabled.

@dragove
Copy link

dragove commented Feb 29, 2024

Sorry, I've tested with previous version, seems not related to Atlas Engine (I've deleted that comment).

first 1.19 release version 1.19.10292.0 can also reproduce this problem. 1.18 works fine.

@H0R5E
Copy link

H0R5E commented Mar 1, 2024

I've started seeing carriage return flickering with PowerShell today (I'm using version 1.19.10573.0).

@panki27
Copy link

panki27 commented Mar 11, 2024

I am also seeing a lot of flicker with python programs using curses, running version 1.19.10573.0.

@lhecker lhecker added the In-PR This issue has a related PR label Mar 28, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 28, 2024
I've found that #16079 was never properly addressed (it still randomly
occurred after even after PR #16349), which later led to the issues
described in #16769 (nushell flickering due to too many flushes).

The crux of the fix is that this brings back the `_noFlushOnEnd` flag
that was removed in PR #15991. This is then combined with a change to
the cork API: An `uncork` on `VtEngine` now only flushes if `_Flush`
got called while it was corked in the first place.

`_noFlushOnEnd` prevents us from flushing in between two "unknown"
VT sequences (like soft fonts or FTCS) which prevents them from being
corrupted. The corking prevents the remaining cases of flushing too
often. Long-term, a proper fix would be to pass through VT unmodified.

Closes #16769
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Mar 28, 2024
DHowett pushed a commit that referenced this issue Apr 16, 2024
I've found that #16079 was never properly addressed (it still randomly
occurred after even after PR #16349), which later led to the issues
described in #16769 (nushell flickering due to too many flushes).

The crux of the fix is that this brings back the `_noFlushOnEnd` flag
that was removed in PR #15991. This is then combined with a change to
the cork API: An `uncork` on `VtEngine` now only flushes if `_Flush`
got called while it was corked in the first place.

`_noFlushOnEnd` prevents us from flushing in between two "unknown"
VT sequences (like soft fonts or FTCS) which prevents them from being
corrupted. The corking prevents the remaining cases of flushing too
often. Long-term, a proper fix would be to pass through VT unmodified.

Closes #16769

(cherry picked from commit 1ede023)
Service-Card-Id: 91965217
Service-Version: 1.20
DHowett pushed a commit that referenced this issue Apr 16, 2024
I've found that #16079 was never properly addressed (it still randomly
occurred after even after PR #16349), which later led to the issues
described in #16769 (nushell flickering due to too many flushes).

The crux of the fix is that this brings back the `_noFlushOnEnd` flag
that was removed in PR #15991. This is then combined with a change to
the cork API: An `uncork` on `VtEngine` now only flushes if `_Flush`
got called while it was corked in the first place.

`_noFlushOnEnd` prevents us from flushing in between two "unknown"
VT sequences (like soft fonts or FTCS) which prevents them from being
corrupted. The corking prevents the remaining cases of flushing too
often. Long-term, a proper fix would be to pass through VT unmodified.

Closes #16769

(cherry picked from commit 1ede023)
Service-Card-Id: 91965216
Service-Version: 1.19
@abhbh
Copy link

abhbh commented Aug 9, 2024

This issue can be reproduced again in 1.20.11781.0

Disabling osc133 in shell_integration is a workaround.

@lhecker
Copy link
Member Author

lhecker commented Aug 9, 2024

The fix has been released in v1.21.1272.0 which is currently in Windows Terminal Preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) In-PR This issue has a related PR Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Conpty For console issues specifically related to conpty Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants