From 6f8a282c0b3a52caf57ded4011e95744768724a9 Mon Sep 17 00:00:00 2001 From: Herby Gillot Date: Thu, 14 Mar 2024 02:17:32 -0400 Subject: [PATCH] bpytop: fix issue where Enter key doesn't register on some systems See: https://github.com/aristocratos/bpytop/issues/410 Fixes: https://trac.macports.org/ticket/69284 Co-authored-by: neverpanic --- sysutils/bpytop/Portfile | 4 +++- sysutils/bpytop/files/patch-pr413.diff | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 sysutils/bpytop/files/patch-pr413.diff diff --git a/sysutils/bpytop/Portfile b/sysutils/bpytop/Portfile index bc18f3979d920..45bc6c7eecc97 100644 --- a/sysutils/bpytop/Portfile +++ b/sysutils/bpytop/Portfile @@ -6,7 +6,7 @@ PortGroup makefile 1.0 github.setup aristocratos bpytop 1.0.68 v github.tarball_from archive -revision 1 +revision 2 description \ Linux/macOS/FreeBSD resource monitor @@ -35,6 +35,8 @@ depends_run-append port:python${python_version} \ makefile.has_destdir yes +patchfiles-append patch-pr413.diff + post-patch { reinplace "s|/usr/bin/env python3|${python_bin}|" ${worksrcpath}/bpytop.py } diff --git a/sysutils/bpytop/files/patch-pr413.diff b/sysutils/bpytop/files/patch-pr413.diff new file mode 100644 index 0000000000000..dd6190456b671 --- /dev/null +++ b/sysutils/bpytop/files/patch-pr413.diff @@ -0,0 +1,12 @@ +# https://github.com/aristocratos/bpytop/pull/413 +--- bpytop.py 2021-12-22 14:22:48 ++++ bpytop.py 2024-03-14 02:13:56 +@@ -840,7 +840,7 @@ + mouse: Dict[str, List[List[int]]] = {} + mouse_pos: Tuple[int, int] = (0, 0) + escape: Dict[Union[str, Tuple[str, str]], str] = { +- "\n" : "enter", ++ ("\n", "\r") : "enter", + ("\x7f", "\x08") : "backspace", + ("[A", "OA") : "up", + ("[B", "OB") : "down",