Turn off error message blinking

Is there some way to disable the blinking error messages? It is extremly anoying.
I have been piping the output of cargo build through cat or tee, which does work, but is there some config or cli option to control the blinking?

1 Like

Rust error messages are not supposed to blink. There must be something unusual about your terminal that is causing it to interpret some of the formatting as blinking. Can you post a screenshot, and tell us which parts are blinking?

9 Likes

I am using a "vanila" xterm (379-1). I added this to Cargo.toml:

[term]                                                                          
color = "never"                                                                 

But that did not help.

Is there some way of completely disabling any sort of escape / control code usage?

Wow, what a theme. I used to be neon green on black, but the other way around is really something. And the font as well. XTerm in general. Consider me fascinated, from a masochistic perspective.

What part of the output is blinking though? I opened XTerm (v330) on my machine, added some warnings and errors to a test program and couldn't replicate any blinking.

11 Likes

The line numbers and the "arrow" from the message to the "src/main.rs:nn:mm" lines. With other errors (eg real errors, not silly warnings), more stuff blinks.

I never liked the "modern" terminals provided by "modern" desktop environments.

My .Xresources file has these settings:

marchhare% grep -i xterm .Xresources 
Mwm*XTerm*iconImage:/users7/vis/heller/icons/terminal32
XTerm*background:       green
XTerm*foreground:       black
XTerm*cursorColor:      red
Xterm*VT100*geometry:   80x33
XTerm*scrollBar:        true
XTerm*font:     -*-fixed-medium-r-normal-*-20-*-*-*-*-*-*-*

And the command line I use to start the xterm is:

/usr/bin/xterm -ls -display $disp -geometry 80x33+0-0 \
        -T "$extra`hostname` .../$dirtemp:t/$cwd:t" \
        -n "$extra`hostname` .../$dirtemp:t/$cwd:t" \
        -iconic -tm 'erase ^h' -sb -e /bin/tcsh -l \
         </dev/null >&~/xterm.log &

If that make any difference. I have things set to use a monochrome xterm (I really dislike "multicolored" text -- it is really hard to read).

Cargo.toml is the manifest for a cargo package, you are supposed to edit the cargo config file for this to have effect, which is named .cargo/config.toml. you can place it inside $CARGO_HOME, default to $HOME/.cargo, but there are other possible locations, the priority is documented here:

7 Likes

I second that. Color me intrigued, pitch-black on venom-green kind of style.

That might be a hurdle. Most of rustc's output has fairly modern terminal tooling in mind.

As @nerditation pointed out: you need to move the [term] into .cargo/config.toml. If that doesn't help, try to export TERM=xterm-mono or the equivalent in your .Xresources.

Yes, the fixed it.

2 Likes

Presumably the problem was that your xterm, in monochrome mode, has decided to render all colored text as blinking instead. Not the choice I'd have made, but…

3 Likes

I checked ANSI escape code - Wikipedia to see if this might be a well-known compatibility issue, and the one sort of blinking it mentions is the code "CSI 3 m" as "Italic. Not widely supported. Sometimes treated as inverse or blink." But at least for me, the line numbers and arrows are blue, not italic.

I've seen cases where sending "true color" RGB color codes to terminals that don't support them results in blinking, but xterm has supported "true color" for a long time.

6 Likes

which part is blinking ?
is it normally displayed ?

Guessing: an xterm with color mode off, might well not support "true color" RGB color codes and so blinks the "colored" text.

You might want to set NO_COLOR=1 in your shell environment. This will disable color codes for a large number of programs, including rustc and cargo.

11 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.