feat: add notify command, modify sidekick with tmux

This commit is contained in:
2026-05-26 16:54:53 +08:00
parent c32e8b4015
commit 4e8e3b7073
5 changed files with 63 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
function notify --description '发送 OSC 777 通知;无参时复用上一条命令的状态与耗时'
set -l rc $status
set -l dur $CMD_DURATION
set -l label
if test (count $argv) -gt 0
set label (string join ' ' $argv)
else if test $rc -eq 0
set label "完成"
else
set label "失败 exit=$rc"
end
set -l body (_notify_human_duration $dur)" · "(hostname -s)" · "(pwd | string replace $HOME '~')
_notify_emit "$label" "$body"
return $rc
end