From 49eb9a44e0255889ca74dfeecc242f747b0f59d8 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sun, 3 Oct 2021 02:16:10 -0400 Subject: patch: newterm (orphan version) Ctrl-Shift-Return now creates a new st terminal, whose CWD is the same as the parent st's CWD. This version of the patch does a double fork, a technique commonly used by daemons to spawn orphan processes. This solution is specific to the swallow patch for dwm which traverses the process tree to determine if the new window is a decendant of a terminal window, in which case the new window should take the place of the terminal window. The way the original newterm patch worked the new st terminal would be a direct decendant of the parent st terminal process, which could lead to the wrong terminal window being swallowed. The double fork method avoids this by leaving all new st terminals as orphans, i.e. they will have no parent process. --- st.h | 1 + 1 file changed, 1 insertion(+) (limited to 'st.h') diff --git a/st.h b/st.h index fd3b0d8..f2b03b0 100644 --- a/st.h +++ b/st.h @@ -81,6 +81,7 @@ void die(const char *, ...); void redraw(void); void draw(void); +void newterm(const Arg *); void printscreen(const Arg *); void printsel(const Arg *); void sendbreak(const Arg *); -- cgit v1.2.3