1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-06 07:20:40 +01:00

feat(iterm2): add shell integration script (#11509)

This commit is contained in:
Zoltán Reegn
2023-02-24 17:27:15 +01:00
committed by GitHub
parent 8a008e1f51
commit bd9c216fe0
4 changed files with 205 additions and 0 deletions

View File

@@ -7,6 +7,17 @@
# This plugin is only relevant if the terminal is iTerm2 on OSX.
if [[ "$OSTYPE" == darwin* ]] && [[ -n "$ITERM_SESSION_ID" ]] ; then
# maybe make it the default in the future and allow opting out?
if zstyle -t ':omz:plugins:iterm2' shell-integration; then
# Handle $0 according to the standard:
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"
# See official docs: https://iterm2.com/documentation-shell-integration.html
source "${0:A:h}/iterm2_shell_integration.zsh"
fi
###
# Executes an arbitrary iTerm2 command via an escape code sequence.
# See https://iterm2.com/documentation-escape-codes.html for all supported commands.