Skip to main content
Bumped by Community user
Bumped by Community user
Add notes on echo to make it make sense in all POSIX shells. Added terminal tag.
Source Link

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences.

Note: All echo in this question works like printf %b, or echo -e in bash and GNU echo.

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this:

echo "\ePtmux;\e\e]9;foobar\007\e\\"

This triggers a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this:

echo "\ePtmux;\e\e]9;foobar\007\e\\"

This triggers a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences.

Note: All echo in this question works like printf %b, or echo -e in bash and GNU echo.

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this:

echo "\ePtmux;\e\e]9;foobar\007\e\\"

This triggers a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

added 14 characters in body
Source Link
janos
  • 11.7k
  • 3
  • 37
  • 54

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux\Ptmux can be used like this: echo "\ePtmux;\e\e]9;foobar\007\e\\" to trigger

echo "\ePtmux;\e\e]9;foobar\007\e\\"

This triggers a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this: echo "\ePtmux;\e\e]9;foobar\007\e\\" to trigger a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this:

echo "\ePtmux;\e\e]9;foobar\007\e\\"

This triggers a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

clarified tput
Source Link

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this: echo "\ePtmux;\e\e]9;foobar\007\e\\" to trigger a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabermcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this: echo "\ePtmux;\e\e]9;foobar\007\e\\" to trigger a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcaber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

Any ideas on this one?

I'm currently running mcabber as my Jabber client (which uses ncurses) in a tmux session on my homeserver. Locally i run iTerm2 as a terminal emulator, which supports the triggering of growl notifications through character escape sequences

e.g. echo "\e]9;foobar\007" makes iTerm2 send a Growl message with the text "foobar".

However, when in a tmux session, the escape sequences get eaten up. Therefore using the proprietary character escape sequence \Ptmux can be used like this: echo "\ePtmux;\e\e]9;foobar\007\e\\" to trigger a growl message from within a tmux session.

However, when I use this in my mcabber event script that gets fired when a new message is received, no notification is triggerd, as if the echo is send to the wrong terminal.

I suppose this has to do with that mcabber which triggers the script is a ncurses application so the output from my normal bash script gets lost and iTerm 2 does never see it.

I also tried calling smcup without success before echoing accoring to some ideas I discovered

tput smcup
echo "\ePtmux;\e\e]9;$FROM: $MSG\007\e\\"
tput rmcup

I suppose this does not work as the issue is not switching back to the "real terminal window", but more directing the output at the ncurses window.

Any ideas on this one?

Tweeted twitter.com/#!/StackUnix/status/183065465483046912
Source Link
Loading