Skip to content

Commit 236c457

Browse files
committed
Added new monitor_encoding project configuration option // Resolve #4350
1 parent 5844c53 commit 236c457

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ PlatformIO Core 6
1616
6.1.1 (2022-??-??)
1717
~~~~~~~~~~~~~~~~~~
1818

19+
* Added new ``monitor_encoding`` project configuration option to configure `Device Monitor <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html>`__ (`issue #4350 <https://github.com/platformio/platformio-core/issues/4350>`_)
1920
* Allowed specifying project environments for `pio ci <https://docs.platformio.org/en/latest/core/userguide/cmd_ci.html>`__ command (`issue #4347 <https://github.com/platformio/platformio-core/issues/4347>`_)
2021
* Show "TimeoutError" only in the verbose mode when can not find a serial port
2122
* Fixed an issue when a serial port was not automatically detected if the board has predefined HWIDs

platformio/device/monitor/command.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@
5656
@click.option("--echo", is_flag=True, help="Enable local echo")
5757
@click.option(
5858
"--encoding",
59-
default="UTF-8",
60-
show_default=True,
61-
help="Set the encoding for the serial port (e.g. hexlify, Latin1, UTF-8)",
59+
help=(
60+
"Set the encoding for the serial port "
61+
"(e.g. hexlify, Latin1, UTF-8) [default=%s]"
62+
% ProjectOptions["env.monitor_encoding"].default
63+
),
6264
)
6365
@click.option(
6466
"-f",

platformio/project/options.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ def get_default_core_dir():
567567
type=click.BOOL,
568568
default=False,
569569
),
570+
ConfigEnvOption(
571+
group="monitor",
572+
name="monitor_encoding",
573+
description="Custom encoding (e.g. hexlify, Latin1, UTF-8)",
574+
default="UTF-8",
575+
),
570576
# Library
571577
ConfigEnvOption(
572578
group="library",

0 commit comments

Comments
 (0)