<p><b>@cladmi</b> requested changes on this pull request.</p>

<p>This needs some adequate testing procedure as it currently breaks existing boards behavior.</p>
<p>In master</p>
<pre><code>BOARD=ruuvitag make --no-print-directory -C examples/hello-world/ term
/home/harter/work/git/RIOT/dist/tools/jlink/jlink.sh term_rtt
### Starting RTT terminal ###
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2019-06-03 12:54:05,915 - WARNING # Host name for TCP connection is missing, defaulting to "localhost"
2019-06-03 12:54:05,915 - INFO # Connect to localhost:19021
2019-06-03 12:54:05,920 - ERROR # Something went wrong connecting to localhost:19021
/home/harter/work/git/RIOT/dist/tools/jlink/jlink.sh: 241: kill: No such process
</code></pre>
<p>With this PR</p>
<pre><code>BOARD=ruuvitag make --no-print-directory -C examples/hello-world/ term
/home/harter/work/git/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200"
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2019-06-03 12:53:59,548 - INFO # Connect to serial port /dev/ttyACM0
2019-06-03 12:53:59,549 - ERROR # Cannot connect to serial port /dev/ttyACM0: could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'
/home/harter/work/git/RIOT/examples/hello-world/../../Makefile.include:550: recipe for target 'term' failed
</code></pre>
<p>Also <code>jlink.sh</code> still uses a non raw configuration for <code>stdio-rtt</code></p>
<p>The pull request contains unrelated changes and some of the fix should really be split before to allow reviewing.</p>
<p>Some new required command require changing the <code>docker</code> image for working which should be addressed with the minimal PR requiring it.</p>
<p>I added the WIP state.</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11099#discussion_r289790517">makefiles/tools/serial.inc.mk</a>:</p>
<pre style='color:#555'>> @@ -16,11 +16,29 @@ RIOT_TERMINAL ?= pyterm
 ifeq ($(RIOT_TERMINAL),pyterm)
   TERMPROG  ?= $(RIOTTOOLS)/pyterm/pyterm
   TERMFLAGS ?= -p "$(PORT)" -b "$(BAUD)"
-else ifeq ($(RIOT_TERMINAL),socat)
-  SOCAT_OUTPUT ?= -
-  TERMPROG ?= $(RIOT_TERMINAL)
-  TERMFLAGS ?= $(SOCAT_OUTPUT) open:$(PORT),b$(BAUD),echo=0,raw
+else ifeq ($(RIOT_TERMINAL),rlwrap)
</pre>
<p>This is unrelated to supporting <code>rawterm</code>.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/11099#discussion_r289790797">makefiles/tools/serial.inc.mk</a>:</p>
<pre style='color:#555'>> @@ -16,11 +16,29 @@ RIOT_TERMINAL ?= pyterm
 ifeq ($(RIOT_TERMINAL),pyterm)
   TERMPROG  ?= $(RIOTTOOLS)/pyterm/pyterm
   TERMFLAGS ?= -p "$(PORT)" -b "$(BAUD)"
-else ifeq ($(RIOT_TERMINAL),socat)
-  SOCAT_OUTPUT ?= -
-  TERMPROG ?= $(RIOT_TERMINAL)
-  TERMFLAGS ?= $(SOCAT_OUTPUT) open:$(PORT),b$(BAUD),echo=0,raw
+else ifeq ($(RIOT_TERMINAL),rlwrap)
+  TERMPROG  ?= $(RIOT_TERMINAL)
+  RLWRAP_PROMPT ?= -pPurple -S 'RIOT $$ '
</pre>
<p>Why even adding a prompt ?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/11099?email_source=notifications&email_token=ABE7WYAVMKAVPOZN4E4WX2TPYT26XA5CNFSM4G3SMWTKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2LYB4Y#pullrequestreview-244809971">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDQGPUUUTUTFNE4LD3PYT26XANCNFSM4G3SMWTA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYELSU42ADT2RG7DZYDPYT26XA5CNFSM4G3SMWTKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2LYB4Y.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/11099?email_source=notifications\u0026email_token=ABE7WYAVMKAVPOZN4E4WX2TPYT26XA5CNFSM4G3SMWTKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2LYB4Y#pullrequestreview-244809971",
"url": "https://github.com/RIOT-OS/RIOT/pull/11099?email_source=notifications\u0026email_token=ABE7WYAVMKAVPOZN4E4WX2TPYT26XA5CNFSM4G3SMWTKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB2LYB4Y#pullrequestreview-244809971",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>