1
0
dotfiles/.config/zsh/rc/terminal.zsh

15 lines
313 B
Bash
Raw Normal View History

2021-04-07 15:40:59 +03:00
#!/bin/zsh
function {
local -a a
2022-07-19 02:41:45 +03:00
local i x
2021-04-07 15:40:59 +03:00
for i ( ${ZSHU_PARENTS_PID} ) ; do
2022-07-19 02:41:45 +03:00
[ -r "/proc/$i/environ" ] || continue
2023-07-20 00:31:30 +03:00
x=$(sed -zEn '/^TERM=(.+)$/{s//\1/;p;}' "/proc/$i/environ" 2>/dev/null)
2021-04-07 15:40:59 +03:00
[ -n "$x" ] || continue
a+=( "$x" )
done
export ORIG_TERM="${a[-1]}"
}