Skip to content

Progress indicator broken on Alacritty with ConPTY #1826

Closed as not planned
Closed as not planned

Description

@LPGhatguy

Problem

When updating a toolchain, Rustup tries to draw over its previous progress indicators, but fails, and instead produces beautiful art:

unknown (6)

Steps

  1. rustup update stable, or another command that causes Rustup to output progress

Possible Solution(s)

Bash in Alacritty in Windows is a pretty weird config. 😄

Notes

Windows 10, Build 1809.

Alacritty has enable_experimental_conpty_backend set, which uses the Windows ConPTY API (1809+ only) instead of WinPTY, which is pretty buggy.

$ alacritty --version
alacritty 0.3.2
$ rustup --version
rustup 1.18.1 :: 1.18.0+20 (462683b3a 2019-04-25) dirty 1 modification

Activity

  1. rbtcollins commented on May 5, 2019

    @rbtcollins
    Contributor

    So this is interesting; it looks like we're either not sending a \r correctly, or the number of spaces being sent to overwrite content is wrong, leading to wrapping to the next line, and so on. Probably some diagnostic testing will be needed to determine what terminfo we're ending up with with term today.

  2. rbtcollins commented on May 5, 2019

    @rbtcollins
    Contributor

    Capturing from discord:
    TERM= rustup toolchain add nightly displays correctly but without colour. TERM=xterm-256color otherwise.

    The term package fallsback to probing the Windows Console via console APIs when TERM is unset, and if that fails, rustup then creates a Terminal object that tries to work with dumb terminals (e.g. just depends on \r and discards attempts to do bold/colour etc).

    So there are two possible code paths we're encountering here when you set TERM=

    • Windows console detected by term.
    • Rustup no-terminfo-fallback.

    So this raises several aspects:
    -> either we have some weird bug, or alacritty isn't actually xterm-256color compatible.
    -> we may have a conpty detection bug
    ->or we may have a bug doing colour on a detected windows console with conpty

    For the latter two need to know which of the code paths we're following; for the former, that seems most likely to be an alacritty issue.
    I'm not sure how to tell which we've encountered from a binary; I suggest building a rustup with some debug code (insert into fn make_terminal<T>(terminfo: Option<TermInfo>) -> Option<Box<Terminal<Output = T> + Send>> in term2.rs). - that should let you determine which path is being followed.

    If the Windows console path is being detected, I would have expected colour to work; so I suspect that its not being detected, and you are ending up with the no-terminfo-fallback.

  3. kinnison commented on May 7, 2019

    @kinnison
    Contributor

    This kind of failure mode is something we attempted to fix with the downgrade of term to before the fallback terminfo thing. I wonder what we could do to output some useful debugging of what kind of terminal object we've ended up with?

  4. davidhewitt commented on Dec 9, 2019

    @davidhewitt

    I just discovered that this issue is not unique to Alacritty: if TERM is set in Windows Terminal then the output is broken in the same way as with Alacritty.

    This might turn out to be an issue in all ConPTY-backed terminal emulators when TERM is set to xterm-256color?

  5. kinnison commented on Dec 10, 2019

    @kinnison
    Contributor

    It's quite probable that this is true yes. ConPTY is not really an ANSI/VTxxx terminal which is part of the reason to want to shift to a more modern windows-aware library.

  6. davidhewitt commented on Dec 10, 2019

    @davidhewitt

    I get the impression from discussion on microsoft/terminal that they're working very hard to support VT (and considering the Windows console APIs mostly for legacy programs).

    If we can identify a VT sequence we're emitting which Windows is handling incorrectly and report it as a bug upstream, I'm fairly sure they'll fix it.

  7. kinnison commented on Dec 13, 2019

    @kinnison
    Contributor

    So a lot of the issue is that terminal IO crates which expect to be able to deal in VT like commands tend to expect terminfo databases to be available at well known POSIX paths. They tend to assume therefore that if they're on Windows, the only thing they should do is ConPTY. What we need is to move to a terminal crate which does a better job of that, such as indicatif and we have an issue open to think about that, but little to no time has been invested yet in working out what it'd take to do.

  8. workingjubilee commented on Apr 29, 2021

    @workingjubilee
    Member

    @rustbot label: +O-windows

  9. kirawi commented on Jul 16, 2021

    @kirawi

    I've got something working, hopefully I'll be able to submit a PR later today.

  10. ryanavella commented on Mar 29, 2023

    @ryanavella

    I'm seeing the same thing on FreeBSD whether TERM is xterm or xterm-256color, so maybe this isn't purely a ConPTY thing?

  11. rami3l commented on Jul 27, 2025

    @rami3l
    Member

    @kirawi @ryanavella Sorry for the long wait, but I am happy to inform you that @FranciscoTGouveia has come up with a new indicatif migration attempt in #4426.

    Since this new implementation has deviated a bit from the original ones in terms of the approach being taken, would you mind verifying if that patch can solve your issue here as well? Many thanks in advance!

  12. rami3l commented on Sep 3, 2026

    @rami3l
    Member

    As there are currently no further actions that can be taken from our side with respect to this issue since the migration to indicatif in #4426, I'm closing it now as stale.

    Please feel free to reopen this issue if you have more information to provide.

    Have a nice day :)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions