]>
Commit | Line | Data |
---|---|---|
1 | [[ -v _sev_home ]] || export _sev_home=$HOME | |
2 | ||
3 | export ZDOTDIR=${XDG_CONFIG_HOME:-~/.config}/zsh | |
4 | ||
5 | ### load site-specific | |
6 | [[ -f ${ZDOTDIR:-~}/.zshenv.local ]] && source ${ZDOTDIR:-~}/.zshenv.local | |
7 | ||
8 | ### fix broken term | |
9 | if [[ ! -v TERM ]] { | |
10 | TERM=xterm-256color >/dev/null 2>&1 | |
11 | } | |
12 | if [[ -o interactive && $#terminfo -eq 0 ]] { | |
13 | _oldterm=$TERM | |
14 | export TERM=xterm >/dev/null 2>&1 | |
15 | print -P "%F{red}!!! Can't find terminfo for $_oldterm, using $TERM%f" | |
16 | unset _oldterm | |
17 | } | |
18 | ||
19 | # NOTE: see .zprofile comment for rationale on sourcing | |
20 | if [[ ! -v _sev_first_display && ( -v DISPLAY || -v WAYLAND_DISPLAY ) ]] { | |
21 | ### update gpgagent to use graphical pinentry | |
22 | # XXX: will be sourced by every new child shell if zsh is not used to | |
23 | # start the graphical session and the _sev_first_display var isn't | |
24 | # exported; for example, this previously happened with sway without a | |
25 | # display manager or launcher in front of it | |
26 | export _sev_first_display= | |
27 | _sev_refresh_gpgagent= source ${ZDOTDIR:-~}/.zprofile | |
28 | } elif [[ ! -o login && $SHLVL == 1 ]] { | |
29 | ### early zprofile sourcing for first shell even if not a login shell | |
30 | source ${ZDOTDIR:-~}/.zprofile | |
31 | } |