repo: dmenu action: commit revision: path_from: revision_from: fd8b26345a5ce905093f30c2ba5491b7a909747d: path_to: revision_to:
commit fd8b26345a5ce905093f30c2ba5491b7a909747d Author: epochDate: Tue Jul 29 19:58:00 2025 -0500 hack in a alt+backspace that acts like it does in bash diff --git a/dmenu.c b/dmenu.c
--- a/dmenu.c
+++ b/dmenu.c
@@ -441,6 +441,13 @@ keypress(XKeyEvent *ev)
case XK_f:
movewordedge(+1);
goto draw;
+ case XK_BackSpace: /* alt+backspace to delete until first / to the left. */
+ while (cursor > 0 && strchr("/", text[nextrune(-1)]))
+ insert(NULL, nextrune(-1) - cursor);
+ while (cursor > 0 && !strchr("/", text[nextrune(-1)]))
+ insert(NULL, nextrune(-1) - cursor);
+ insert("/",nextrune(+1) - cursor); // reinsert the / the got removed to make it act like bash.
+ break;
case XK_g: ksym = XK_Home; break;
case XK_G: ksym = XK_End; break;
case XK_h: ksym = XK_Up; break;
-----END OF PAGE-----