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

14 lines
310 B
Bash
Raw Normal View History

2021-04-07 15:40:59 +03:00
#!/bin/zsh
function {
local -a a
local x
for i ( ${ZSHU_PARENTS_PID} ) ; do
[ -r /proc/$i/environ ] || continue
x=$(tr '\0' '\n' < /proc/$i/environ | sed -En '/^TERM=(.+)$/{s//\1/;p;}')
[ -n "$x" ] || continue
a+=( "$x" )
done
export ORIG_TERM="${a[-1]}"
}