Skip to content

Commit 9765e73

Browse files
committed
Add monitor commands using less and cat.
Use `less` as the default `MONITOR_CMD`. Change comment explenation about `# Serial Monitor`.
1 parent 8ff6f8a commit 9765e73

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Arduino.mk

+9-6
Original file line numberDiff line numberDiff line change
@@ -936,11 +936,11 @@ ifndef ARDUINO_LIBS
936936
endif
937937

938938
########################################################################
939-
# Serial monitor (just a screen wrapper)
939+
# Serial monitor
940940

941-
# Quite how to construct the monitor command seems intimately tied
942-
# to the command we're using (here screen). So, read the screen docs
943-
# for more information (search for 'character special device').
941+
# In order to construct a monitor command, we need to use either `less`,
942+
# `screen` or `cat`. With `less`, as the default fallback, we will use
943+
# `-f` flag. Read it's man page to get a better understanding.
944944

945945
ifeq ($(strip $(NO_CORE)),)
946946
ifndef MONITOR_BAUDRATE
@@ -958,9 +958,8 @@ ifeq ($(strip $(NO_CORE)),)
958958
else
959959
$(call show_config_variable,MONITOR_BAUDRATE, [USER])
960960
endif
961-
962961
ifndef MONITOR_CMD
963-
MONITOR_CMD = screen
962+
MONITOR_CMD = less
964963
endif
965964
endif
966965

@@ -1763,6 +1762,10 @@ else ifeq ($(notdir $(MONITOR_CMD)), picocom)
17631762
$(MONITOR_CMD) -b $(MONITOR_BAUDRATE) $(MONITOR_PARAMS) $(call get_monitor_port)
17641763
else ifeq ($(notdir $(MONITOR_CMD)), cu)
17651764
$(MONITOR_CMD) -l $(call get_monitor_port) -s $(MONITOR_BAUDRATE)
1765+
else ifeq ($(MONITOR_CMD), less)
1766+
$(MONITOR_CMD) -f $(call get_monitor_port)
1767+
else ifeq ($(MONITOR_CMD), cat)
1768+
$(MONITOR_CMD) $(call get_monitor_port)
17661769
else
17671770
$(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
17681771
endif

0 commit comments

Comments
 (0)