File tree 3 files changed +25
-0
lines changed 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,19 @@ impl Shell {
251
251
Ok ( ( ) )
252
252
}
253
253
254
+ pub fn set_unicode ( & mut self , yes : bool ) -> CargoResult < ( ) > {
255
+ if let ShellOut :: Stream {
256
+ ref mut stdout_unicode,
257
+ ref mut stderr_unicode,
258
+ ..
259
+ } = self . output
260
+ {
261
+ * stdout_unicode = yes;
262
+ * stderr_unicode = yes;
263
+ }
264
+ Ok ( ( ) )
265
+ }
266
+
254
267
pub fn set_hyperlinks ( & mut self , yes : bool ) -> CargoResult < ( ) > {
255
268
if let ShellOut :: Stream {
256
269
ref mut hyperlinks, ..
Original file line number Diff line number Diff line change @@ -1049,6 +1049,9 @@ impl GlobalContext {
1049
1049
if let Some ( hyperlinks) = term. hyperlinks {
1050
1050
self . shell ( ) . set_hyperlinks ( hyperlinks) ?;
1051
1051
}
1052
+ if let Some ( unicode) = term. unicode {
1053
+ self . shell ( ) . set_unicode ( unicode) ?;
1054
+ }
1052
1055
1053
1056
self . progress_config = term. progress . unwrap_or_default ( ) ;
1054
1057
@@ -2646,6 +2649,7 @@ pub struct TermConfig {
2646
2649
pub quiet : Option < bool > ,
2647
2650
pub color : Option < String > ,
2648
2651
pub hyperlinks : Option < bool > ,
2652
+ pub unicode : Option < bool > ,
2649
2653
#[ serde( default ) ]
2650
2654
#[ serde( deserialize_with = "progress_or_string" ) ]
2651
2655
pub progress : Option < ProgressConfig > ,
Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ quiet = false # whether cargo output is quiet
182
182
verbose = false # whether cargo provides verbose output
183
183
color = ' auto' # whether cargo colorizes output
184
184
hyperlinks = true # whether cargo inserts links into output
185
+ unicode = true # whether cargo can render output using non-ASCII unicode characters
185
186
progress.when = ' auto' # whether cargo shows progress bar
186
187
progress.width = 80 # width of progress bar
187
188
```
@@ -1298,6 +1299,13 @@ Can be overridden with the `--color` command-line option.
1298
1299
1299
1300
Controls whether or not hyperlinks are used in the terminal.
1300
1301
1302
+ #### ` term.unicode `
1303
+ * Type: bool
1304
+ * Default: auto-detect
1305
+ * Environment: ` CARGO_TERM_UNICODE `
1306
+
1307
+ Control whether output can be rendered using non-ASCII unicode characters.
1308
+
1301
1309
#### ` term.progress.when `
1302
1310
* Type: string
1303
1311
* Default: "auto"
You can’t perform that action at this time.
0 commit comments