mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-19 02:00:06 +02:00
Create a default zshrc file that sets up the prompt to behave the same as the bash one set by Haiku. There was an attempt to patch the prompt in zprofile already (after sourcing /etc/profile), but the prompt is now too complex for the simple substitutions to work. Avoids the problem reported in https://dev.haiku-os.org/ticket/17652
18 lines
530 B
Bash
18 lines
530 B
Bash
# Emulate ksh as a walkaround for ksh-syntax within /etc/profile
|
|
emulate ksh -c 'source /etc/profile'
|
|
|
|
# Migration path for users who rely on the old behavior
|
|
(
|
|
setopt EXTENDED_GLOB
|
|
if [[ -n $ZDOTDIR && -z $ZDOTDIR/.z(login|logout|profile|shrc|shenv)(#qN) ]]; then
|
|
for i in "$HOME/config/settings/zsh"/z(login|logout|profile|shrc|shenv)(#qN)
|
|
do
|
|
local target=$ZDOTDIR/.$(basename "$i")
|
|
echo "Symlinking $i to $target..."
|
|
ln -sv "$i" "$target"
|
|
unset target
|
|
done
|
|
[[ -e $ZDOTDIR/.zshenv ]] && source $ZDOTDIR/.zshenv
|
|
fi
|
|
)
|