为什么我的 rust shell 输出到处都是格式字符?

问题描述 投票:0回答:1

当我使用 rust 命令

rustup
cargo
时,我的输出中到处都是输出格式标记字符:
$<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

我在

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
rust zsh iterm2 rustup
1个回答
0
投票

能够通过将我的仿真模式从

xterm-256color
更改为
vt100
来重现这一点。

在 iterm2 中,在 Preferences > Profiles > Terminal 下,将 Report terminal type

vt100
更新为
xterm-256color
。您必须打开一个新终端才能生效。

© www.soinside.com 2019 - 2024. All rights reserved.