{
  "id": 13814277,
  "title": "The tilde in your PATH may not be your HOME",
  "url": "https://urgent.news/2026/10/11/the-tilde-in-your-path-may-not-be-your-home",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-11T12:13:13.000Z",
  "source": {
    "name": "Hacker News Best",
    "slug": "hacker-news-best",
    "url": "https://disconnect3d.pl//2026/10/02/dont-put-tilde-in-your-path/"
  },
  "original_language": "en",
  "account": "A recent issue surfaced while testing the nono agent sandboxing tool, which alerted users to a potential problem with their PATH environment variable. Specifically, the sandbox detected entries in PATH that could be written to, such as ~/.local/bin/. The warning suggested that simply adding ~ (tilde) to the PATH could lead to unexpected behavior, as the tilde expansion only occurs in unquoted inputs.\n\nAccording to the bash documentation, tilde-prefixes, which begin with an unquoted tilde character (~), are expanded only when followed by the first unquoted slash (/) or the first equals sign (=). This means that if a user includes ~ in their PATH, it will expand to the current user's home directory only if the tilde is not enclosed within quotes.\n\nIn the example given, instead of adding /home/user/.local/bin/ to PATH, the sandbox encountered ./~/.local/bin/ added to PATH. This discrepancy occurred because the tilde expansion was performed in the variable assignment after the equals sign (=) or after each colon (:). However, relying on this behavior is considered fragile, as it can be broken by whitespace or other factors.\n\nTo check for this issue, users can run a simple command that prints the PATH, replacing all instances of ~ with $HOME. If the command outputs anything, it indicates that the PATH should be updated with the correct $HOME notation. The nono tool provided a valuable warning about this potential issue, although it could benefit from more detailed explanations in the future.",
  "summary": "Article URL: https://disconnect3d.pl//2026/10/02/dont-put-tilde-in-your-path/ Comments URL: https://news.ycombinator.com/item?id=50042425 Points: 195 # Comments: 135",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}