@@ -936,11 +936,11 @@ ifndef ARDUINO_LIBS
936936endif
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
945945ifeq ($(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
965964endif
966965
@@ -1763,6 +1762,10 @@ else ifeq ($(notdir $(MONITOR_CMD)), picocom)
17631762 $(MONITOR_CMD) -b $(MONITOR_BAUDRATE) $(MONITOR_PARAMS) $(call get_monitor_port)
17641763else 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)
17661769else
17671770 $(MONITOR_CMD) $(call get_monitor_port) $(MONITOR_BAUDRATE)
17681771endif
0 commit comments