Skip to content

Commit 4fa55fb

Browse files
committed
scripts: west_commands: core: run netcat with check_call()
Netcat (nc) does not handle SIGINT. It silently ignores it. We cannot use run_client(), given that the pydoc for run_client() specifically contains "Run a client that handles SIGINT". Instead, use check_call(), which correctly handles Ctrl+C. Signed-off-by: Chris Friedt <[email protected]>
1 parent f7ff830 commit 4fa55fb

File tree

1 file changed

+2
-1
lines changed
  • scripts/west_commands/runners

1 file changed

+2
-1
lines changed

scripts/west_commands/runners/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,8 @@ def run_telnet_client(self, host: str, port: int) -> None:
923923
# CONFIG_SHELL_VT100_COMMANDS etc.
924924
if shutil.which('nc') is not None:
925925
client_cmd = ['nc', host, str(port)]
926-
self.run_client(client_cmd)
926+
# Note: netcat (nc) does not handle sigint, so cannot use run_client()
927+
self.check_call(client_cmd)
927928
return
928929

929930
# Otherwise, use a pure python implementation. This will work well for logging,

0 commit comments

Comments
 (0)