mirror of
https://github.com/notwa/rc
synced 2024-11-05 06:29:02 -08:00
don't reset terminal charset on alacritty (fixes glitch)
This commit is contained in:
parent
e66820c81a
commit
d54c1c5808
2 changed files with 20 additions and 17 deletions
|
@ -22,7 +22,7 @@ _temporary_scope_() {
|
|||
local USASCII="B" SPECIAL="0" # charsets: sane default & line drawing
|
||||
local DECTCEM="25"
|
||||
local DECSET="h" SGR="m" # final characters of a command sequence
|
||||
local sanity="$ESC$G0$USASCII$SI$CSI?$DECTCEM$DECSET"
|
||||
local sanity="$CSI?$DECTCEM$DECSET"
|
||||
local color1="$CSI;--$SGR" color2="$CSI--;97$SGR" reset="$hide$CSI$SGR$show"
|
||||
local line1="$hide$title$sanity$color1$show $reset"
|
||||
local line2="$hide$color2$show$prompt$reset "
|
||||
|
@ -31,6 +31,7 @@ _temporary_scope_() {
|
|||
if [ "$t" = xterm ] || [ "$t" = screen ] || [ "$t" = tmux ]; then
|
||||
[ "$t" = tmux ] && title="$cwd" || title="$host: $cwd"
|
||||
title="${OSC}2;$title$BEL"
|
||||
sanity="$ESC$G0$USASCII$SI$sanity"
|
||||
fi
|
||||
PROMPT_COMMAND="[ \$? = 0 ] && PS1=\$'$ret_okay' || PS1=\$'$ret_fail'"
|
||||
}; _temporary_scope_; unset -f _temporary_scope_
|
||||
|
|
34
home/zshrc
34
home/zshrc
|
@ -224,22 +224,6 @@ alias sc="~/sh/sc" # only runs in bash (for now), so be explicit with path
|
|||
function {
|
||||
# initialize prompts.
|
||||
|
||||
local t="${TERM%%-*}"
|
||||
if [ "$t" = xterm ] || [ "$t" = screen ] || [ "$t" = tmux ]; then
|
||||
# set window title
|
||||
if [ "$t" = tmux ]; then
|
||||
# don't include host, tmux prepends it
|
||||
precmd() { print -Pn "\e]2;%~\a" }
|
||||
else
|
||||
precmd() { print -Pn "\e]2;%M: %~\a" }
|
||||
fi
|
||||
else
|
||||
# act dumb
|
||||
precmd() {}
|
||||
PROMPT="%# "
|
||||
return
|
||||
fi
|
||||
|
||||
# zsh adds a % symbol to newline-less output, so my bash prompt is overkill
|
||||
# NOTE: i've started hardcoding escapes instead of relying on zsh
|
||||
# because detecting terminal features is too troublesome.
|
||||
|
@ -259,6 +243,24 @@ function {
|
|||
(sabotage) good=45;; # magenta
|
||||
esac
|
||||
|
||||
local t="${TERM%%-*}"
|
||||
if [ "$t" = xterm ] || [ "$t" = screen ] || [ "$t" = tmux ]; then
|
||||
# set window title
|
||||
if [ "$t" = tmux ] # don't include host, tmux prepends it
|
||||
then precmd() { print -Pn "\e]2;%~\a" }
|
||||
else precmd() { print -Pn "\e]2;%M: %~\a" }
|
||||
fi
|
||||
elif [ "$t" = alacritty ]; then
|
||||
# Alacritty-v0.13.2-portable.exe -t "MinGW x64" -e "usr/bin/env" PATH="/usr/local/sbin:/usr/local/bin:/usr/bin" MSYSTEM=MINGW64 TERM=alacritty shelly
|
||||
precmd() {}
|
||||
chset= # displays as U+263C for some reason
|
||||
else
|
||||
# act dumb
|
||||
precmd() {}
|
||||
PROMPT="%# "
|
||||
return
|
||||
fi
|
||||
|
||||
PROMPT="%{$chset$curse$reset$s%(?.$good.$bad);97$e%}%#%{$reset%} "
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue