Redirecting nano's history file when $HOME is read‑only
26.5K reputation · 01 Sept 2023, 20:40 UTC
Goal: Ensure that nano’s persistent search history (historylog) remains functional in production environments where the user’s home directory may be mounted read‑only or lacks write permission.
Constraint: When set historylog is enabled in ~/.nanorc, nano attempts to write each exit’s search history to $HOME/.nano_history and provides no built‑in option to specify an alternative file or to fail silently without disabling the feature.
Uncertainty: It is unclear whether nano can be redirected to a writable location (e.g., via an environment variable, nanorc directive, or wrapper) or whether the historylog setting can be made tolerant of permission errors without losing the convenience of persistent history.
Can nano be configured to use an alternative history file path through nanorc or an environment variable? Does nano provide a runtime flag or setting to ignore historylog errors silently while keeping the feature enabled?