How to get a notification from actions on a remote host? #1525
-
How do I get a notification when a command has completed? How do I ring the bell? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Blink Shell comes with standard OSC sequences support. You can test it by pasting the below command into the terminal. echo -e "\033]777;notify;Blink Shell;Hello form Blink Shell of the notification\a" You should see a notification like this one. Notifications will work on remote servers over ssh, as long as you are connected to the server, but aren't supported in Mosh and by default in set -g allow-passthrough on And try the code below: echo -e "\\033Ptmux;\033\033]777;notify;Blink Shell;Hello from Blink Shell notification\a\033\\" As you can see, tmux must pass an escape sequence with the You can read more about it in the tmux FAQ. Real-life exampleHere you can see a real-life usage example. This script builds VIM from the source. Upon successful completion, it displays a notification that works in both SSH and git clone --depth=1 https://github.com/vim/vim.git "$HOME/vim"
cd "$HOME/vim" || return
./configure --with-features=huge
make
sudo make install
cd && sudo rm -rfv "$HOME/vim"
if [ "$TERM_PROGRAM" = "tmux" ]; then
echo -e "\\033Ptmux;\033\033]777;notify;VIM;Build from source completed\a\033\\"
else
echo -e "\033]777;notify;VIM;Build from source completed\a"
fi More information
|
Beta Was this translation helpful? Give feedback.
Blink Shell comes with standard OSC sequences support. You can test it by pasting the below command into the terminal.
You should see a notification like this one.
Notifications will work on remote servers over ssh, as long as you are connected to the server, but aren't supported in Mosh and by default in
tmux
. To make it work intmux
, add this into.tmux.conf
.set -g allow-passthrough on
And try the code below:
As you can see, tmux must pass an escape sequence with the
tmux;
prefix to make it work. Any\033
ch…