From 4fa55fb8000ef1c4c5d8080449f146f4b16cc5db Mon Sep 17 00:00:00 2001 From: Chris Friedt Date: Sun, 10 Nov 2024 09:23:26 -0500 Subject: [PATCH] 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 --- scripts/west_commands/runners/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index db5408c8f5164..69491f1990df0 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -923,7 +923,8 @@ def run_telnet_client(self, host: str, port: int) -> None: # CONFIG_SHELL_VT100_COMMANDS etc. if shutil.which('nc') is not None: client_cmd = ['nc', host, str(port)] - self.run_client(client_cmd) + # Note: netcat (nc) does not handle sigint, so cannot use run_client() + self.check_call(client_cmd) return # Otherwise, use a pure python implementation. This will work well for logging,