为什么我的Rust shell输出中充满了格式字符?

huangapple go评论64阅读模式
英文:

Why is my rust shell output littered with format characters?

问题

当我使用 Rust 命令 rustupcargo 时,我的输出中充满了似乎是输出格式标记字符的内容:$<2>

我在 zsh 上使用 iterm2,系统信息如下:

Darwin kevs-mbp-3.lan 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64

为什么会出现这种情况?

更新:

% echo $TERM
vt100
% echo $COLORTERM
truecolor
英文:

When I use rust commands rustup or cargo my output is littered with what appear to be output format markup characters: $<2>

$<2>info: $<2>syncing channel updates for 'stable-x86_64-apple-darwin'
$<2>info: $<2>latest update on 2023-02-09, rust version 1.67.1 (d5a82bbd2 2023-02-07)
$<2>info: $<2>downloading component 'cargo'
$<2>info: $<2>downloading component 'clippy'
$<2>info: $<2>downloading component 'rust-docs'
 19.4 MiB /  19.4 MiB (100 %)   8.8 MiB/s in  2s ETA:  0s
$<2>info: $<2>downloading component 'rust-std'
 27.9 MiB /  27.9 MiB (100 %)   9.1 MiB/s in  3s ETA:  0s
$<2>info: $<2>downloading component 'rustc'
 56.6 MiB /  56.6 MiB (100 %)   9.5 MiB/s in  6s ETA:  0s
$<2>info: $<2>downloading component 'rustfmt'
$<2>info: $<2>installing component 'cargo'
$<2>info: $<2>installing component 'clippy'
$<2>info: $<2>installing component 'rust-docs'
 19.4 MiB /  19.4 MiB (100 %)   3.7 MiB/s in  3s ETA:  0s
$<2>info: $<2>installing component 'rust-std'
 27.9 MiB /  27.9 MiB (100 %)  14.4 MiB/s in  1s ETA:  0s
$<2>info: $<2>installing component 'rustc'
 56.6 MiB /  56.6 MiB (100 %)  17.4 MiB/s in

I am on zsh on iterm2

on
Darwin kevs-mbp-3.lan 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64

Why ?

Update:

% echo $TERM
vt100
% echo $COLORTERM
truecolor

答案1

得分: 2

通过将仿真模式从xterm-256color更改为vt100,我成功复制了这个问题。

在iterm2中,在首选项 > 配置文件 > 终端下,将报告终端类型vt100更新为xterm-256color。您需要打开一个新的终端才能使此更改生效。

为什么我的Rust shell输出中充满了格式字符?

英文:

Was able to reproduce this by changing my emulation mode from xterm-256color to vt100.

In iterm2, under Preferences > Profiles > Terminal, update Report terminal type from vt100 to xterm-256color. You will have to open a new terminal for this to take effect.

为什么我的Rust shell输出中充满了格式字符?

huangapple
  • 本文由 发表于 2023年2月24日 11:05:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75552271.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定