Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/lib/_Z_Utils.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,12 @@ function z_Setup_Environment() {

# Set up terminal capabilities if not already set
function setup_Terminal_Capabilities() {
# Only initialize if they aren't already defined
if [[ -z "$Term_Reset" ]]; then
# Only initialize if they aren't already declared.
# Check variable existence, not emptiness: in non-tty environments,
# Term_Reset is set to empty string at line ~302 but is still readonly.
# Using -z would see "empty" and try to re-set it, crashing with
# "read-only variable".
if ! typeset -p Term_Reset >/dev/null 2>&1; then
# Initialize terminal capabilities
typeset -g Term_Reset="$(tput sgr0 2>/dev/null || echo '')"
typeset -g Term_Bold="$(tput bold 2>/dev/null || echo '')"
Expand Down