Skip to content

install-local exits silently when TERM is unset because tput runs under set -e #2134

Description

@f-trycua

Summary

libs/lume/scripts/install-local.sh can exit immediately and silently in non-interactive shells when TERM is unset. The script runs several tput assignments under set -e, so a failing tput command aborts the installer before any useful output is printed.

Reproduction

unset TERM
./libs/lume/scripts/install-local.sh

Observed locally: the command exited with status 1 and no output.

Expected behavior

The local installer should either:

  • run without color formatting when terminal capabilities are unavailable, or
  • print a clear actionable error.

Likely cause

Near the top of install-local.sh, the script does:

set -e
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
BLUE=$(tput setaf 4)
YELLOW=$(tput setaf 3)

When TERM is unset, tput exits non-zero, and set -e aborts the script.

Suggested fix

Guard color initialization and fall back to empty strings, e.g. only call tput when TERM is set and tput succeeds, or append safe fallbacks to each assignment. This would make the installer robust in Codex/CI/non-interactive shells while preserving color output in normal terminals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions