diff --git a/config.def.h b/config.def.h index 82f282f..8e36213 100644 --- a/config.def.h +++ b/config.def.h @@ -389,6 +389,12 @@ static MouseShortcut maltshortcuts[] = { static char *openurlcmd[] = { "/bin/sh", "-c", "xurls | dmenu -l 10 -w $WINDOWID | xargs -r open", "externalpipe", NULL }; + +#if EXTERNALPIPEIN_PATCH // example command +static char *setbgcolorcmd[] = { "/bin/sh", "-c", + "printf '\033]11;#008000\007'", + "externalpipein", NULL }; +#endif // EXTERNALPIPEIN_PATCH #endif // EXTERNALPIPE_PATCH static Shortcut shortcuts[] = { @@ -425,6 +431,9 @@ static Shortcut shortcuts[] = { #endif // NEWTERM_PATCH #if EXTERNALPIPE_PATCH { TERMMOD, XK_U, externalpipe, { .v = openurlcmd } }, + #if EXTERNALPIPEIN_PATCH + { TERMMOD, XK_M, externalpipein, { .v = setbgcolorcmd } }, + #endif // EXTERNALPIPEIN_PATCH #endif // EXTERNALPIPE_PATCH #if KEYBOARDSELECT_PATCH { TERMMOD, XK_Escape, keyboard_select, { 0 } }, diff --git a/st.c b/st.c index 04380ff..0c557f0 100644 --- a/st.c +++ b/st.c @@ -1090,15 +1090,16 @@ ttynew(const char *line, char *cmd, const char *out, char **args) #endif // RIGHTCLICKTOPLUMB_PATCH die("pledge\n"); #endif - close(s); - cmdfd = m; #if EXTERNALPIPEIN_PATCH && EXTERNALPIPE_PATCH csdfd = s; + cmdfd = m; memset(&sa, 0, sizeof(sa)); sigemptyset(&sa.sa_mask); sa.sa_handler = sigchld; sigaction(SIGCHLD, &sa, NULL); #else + close(s); + cmdfd = m; signal(SIGCHLD, sigchld); #endif // EXTERNALPIPEIN_PATCH break;