The reason why an event-script fails to send a "growler" message is that mcabber
closes the standard input, output and error streams when it runs an event command. You can see this in hooks.c
:
if ((pid=fork()) == -1) {
scr_LogPrint(LPRINT_LOGNORM, "Fork error, cannot launch external command.");
g_free(datafname);
return;
}
if (pid == 0) { // child
// Close standard file descriptors
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
if (execl(extcmd, extcmd, arg_type, arg_info, bjid, arg_data,
(char *)NULL) == -1) {
// scr_LogPrint(LPRINT_LOGNORM, "Cannot execute external command.");
exit(1);
}
}
g_free(datafname);
That makes the event script run without interfering with the streams used by mcabber
.
There is no special ncurses mode intercepting the message (after all, tmux
is already running as a terminfo application). You can probably work around the problem by redirecting your echo
(preferably printf
) to /dev/tty
, e.g.,
#!/bin/sh
printf '\033Ptmux;\033\033]9;foobar\007\033\\' >/dev/tty
From the tmux FAQ:
******************************************************************************
* PLEASE NOTE: most display problems are due to incorrect TERM! Before *
* reporting problems make SURE that TERM settings are correct inside and *
* outside tmux. *
* *
* Inside tmux TERM must be "screen" or similar (such as "screen-256color"). *
* Don't bother reporting problems where it isn't! *
* *
* Outside, it must match your terminal: particularly, use "rxvt" for rxvt *
* and derivatives. *
******************************************************************************
http://tmux.git.sourceforge.net/git/gitweb.cgi?p=tmux/tmux;a=blob;f=FAQ
Best Answer
Detach from currently attached session
Session
Ctrl+ b d or Ctrl+ b
:detach
Screen
Ctrl+ a Ctrl+ d or Ctrl+ a
:detach