macos terminal.app解释器
mac-terminal-interpreter的Python项目详细描述
安装
$ [sudo] pip install mac-terminal-interpreter
好处
- 在
Terminal.app
中打开,即使没有.command
扩展 - stdout,stderr日志
- 使
.command
文件可执行 窗口关闭选项(不关闭,关闭,如果外壳退出干净,关闭总是)- 显示非零退出状态
- 错误时的铃声通知
工作原理
Terminal.app
中打开,即使没有.command
扩展.command
文件可执行script.ext
#!/usr/bin/env terminal
...
stdout,stderr日志:
~/Library/Logs/<slug>/<date>/out.log
~/Library/Logs/<slug>/<date>/err.log
配置
~/.bashrc
:
exportMAC_TERMINAL_CLOSE=0# doesn't close (default)exportMAC_TERMINAL_CLOSE=1# close if the shell exited cleanlyexportMAC_TERMINAL_CLOSE=2# close always
终端错误声音:
$ defaults write .GlobalPreferences com.apple.sound.beep.sound /System/Library/Sounds/Basso.aiff
脚本使用
command | ^{ |
---|---|
^{ | ^{ |