Skip to content

Conversation

@midchildan
Copy link

@midchildan midchildan commented Dec 21, 2025

Terminfo databases can become corrupted on macOS hosts due to the following reasons:

  1. The ncurses package, responsible for most terminfo database files, contains entries that have case conflicts.
  2. The Nix store is often backed by a case-insensitive file system on macOS.

Nix attempts to resolve these case conflicts by renaming the problematic files. However, this breaks terminal functionality since the affected terminfo entries become undetectable by software that uses them.

Example of affected directories:

# ls /run/current-system/sw/share/terminfo
1@  6@  a~nix~case~hack~1@  e~nix~case~hack~1@  j@                  m~nix~case~hack~1@  p~nix~case~hack~1@  t@  x~nix~case~hack~1@
2@  7@  b@                  f@                  k@                  N@                  Q@                  u@  z@
3@  8@  c@                  g@                  L@                  n~nix~case~hack~1@  q~nix~case~hack~1@  v@
4@  9@  d@                  h@                  l~nix~case~hack~1@  o@                  r@                  w@
5@  A@  E@                  i@                  M@                  P@                  s@                  X@

An example of the resulting error:

/etc/zprofile:30: can't find terminal definition for xterm-256color

To mitigate case conflicts, this PR makes the guest system copy terminfo entries from directories with lowercase letters to their uppercase counterparts. This ensures that when the Nix store is case-insensitive, access to x/xterm-256color will redirect to its copy, X/xterm-256color. Conversely, when the Nix store is case-sensitive, x/xterm-256color can still be accessed directly.

Closes #101

@midchildan midchildan force-pushed the feat/fs-case-sensitivity-workaround branch from 38c0534 to c7cd8af Compare December 21, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect terminal display

1 participant