The Tilde In Your PATH May Not Be Your HOME
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

A report by Disconnect3d explains that writing a quoted `~` in a shell PATH assignment can leave the tilde literal rather than turn it into the home directory. The suggested fix is to use `$HOME`, and users can check PATH for entries containing `~`.

A warning from the nono agent sandboxing tool led developer Disconnect3d to flag a shell configuration mistake: putting a quoted tilde (`~`) in PATH may leave it as a literal character instead of expanding it to the user’s home directory. The report, published Oct. 2, recommends using `$HOME` in quoted PATH assignments.

Buying for a business?Offer from Amazon

Get business pricing on monitors, keyboards and dev gear

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

Disconnect3d said nono warned that a PATH entry the sandbox could write to appeared as `~/.local/bin/`. The post traces the issue to a common-looking shell configuration line: `export PATH=”$PATH:~/.local/bin/”`. Because the tilde is inside quotes, it is not expanded to the home path in this assignment. The resulting PATH entry can refer to a directory literally named `~`, relative to the current directory, rather than the intended directory under the user’s home.

To avoid that behavior, the post recommends writing `export PATH=”$PATH:$HOME/.local/bin/”`. Disconnect3d notes that an unquoted assignment such as `export PATH=$PATH:~/.local/bin` does expand the tilde in Bash and Zsh, including after a colon in an assignment. However, the author describes that form as fragile: adding whitespace can change how the shell parses the assignment.

The post demonstrates the practical effect with a small program placed in `./~/.local/bin/`. With PATH set to `~/.local/bin/`, the shell found and ran that program. This shows that a command can appear to work while being resolved from a literal tilde directory—not from the home directory. The example is a demonstration in the author’s environment, not evidence that every affected configuration will produce the same result in every shell or working directory.

At a glance
reportWhen: Published Oct. 2, 2026
The developmentA post published by Disconnect3d on Oct. 2 describes a PATH configuration mistake surfaced by a warning from the nono sandboxing tool.

How a Literal Tilde Changes Command Lookup

PATH tells a shell where to search when a user enters a command without specifying its full location. If an entry intended to point into the home directory instead contains a literal tilde, command lookup may depend on whether a matching relative directory exists from the current working directory. That can make behavior confusing: a command might fail in one location yet run in another.

The warning also has a security relevance. Disconnect3d says nono identified the entry as a location the sandbox could write to. The post does not claim that this configuration automatically creates a security vulnerability, or that a malicious file was involved. It does show why accurately understanding PATH matters when tools assess which directories can supply executable commands.

For readers, the practical point is narrow and easy to check: in quoted shell assignments, use `$HOME` rather than `~` when constructing a home-directory path, then inspect the resulting PATH. This can prevent a misleading entry from being mistaken for the intended location.

As an affiliate, we earn on qualifying purchases.

Shell Expansion Behind the Warning

The report is based on an observation made while Disconnect3d was using nono, described in the post as an agent sandboxing tool. The warning listed `~/.local/bin/` among PATH entries the sandbox could write to, prompting the author to test whether the entry actually referred to the home directory.

As the post explains, Bash expands an unquoted tilde in specified positions, including in variable assignments after an equals sign or colon. Quoting changes that behavior: in the example `”$PATH:~/.local/bin/”`, the tilde is quoted and remains literal. The author says the unquoted version works in both Bash and Zsh in this assignment form, but favors `$HOME` because it is explicit and less sensitive to changes in how the line is written.

Disconnect3d also provides a quick check: `echo “$PATH” | grep — ‘~’`. To display entries separately, the post suggests splitting PATH at colons before searching. Finding a tilde is a reason to inspect the relevant shell startup file, such as `.bashrc`, `.zshrc` or `.profile`; it does not by itself establish that every match is an error.

What the Check Can and Cannot Show

The report does not establish how many users have this configuration or how often it causes command failures. It is a technical explanation and demonstration by Disconnect3d, rather than a survey of shell setups or an independent evaluation of nono’s warning behavior.

A PATH search that finds `~` identifies an entry worth reviewing, but the report does not say that every such entry is necessarily incorrect. The effect can depend on the exact assignment, quoting, shell and surrounding configuration. The post’s demonstrated case concerns a quoted tilde in a PATH value; it does not provide a broader audit of shell differences or sandbox policies.

It is also unclear from the report whether nono’s warning wording has since been changed. Disconnect3d said a pull request was forthcoming, but the source material does not confirm that it was submitted, merged or released.

Review Startup Files and PATH Entries

Readers who want to check their setup can inspect PATH for a tilde with the command shown in the report, then review any matching entry in their shell startup files. Where the intent is to add a directory inside the home folder, the suggested quoted form is `$HOME/.local/bin/`. Users should confirm the actual PATH value after editing rather than assume the configuration line expanded as intended.

Disconnect3d’s next stated step was a pull request to improve nono’s warning. The report gives no later status for that change. Whether the tool’s warning becomes more descriptive, and whether its behavior varies across environments, remain open based on the source material.

Key Questions

Does `~` in PATH always mean the home directory?

No. In the reported example, a quoted tilde in the PATH assignment remained literal. Whether tilde expansion occurs depends on how the shell parses the assignment.

What should I use instead of a quoted tilde?

Disconnect3d recommends `$HOME`, for example: `export PATH=”$PATH:$HOME/.local/bin/”`.

How can I check for a tilde in PATH?

The post suggests `echo “$PATH” | grep — ‘~’`. A match means you should inspect the entry and its source; it does not automatically prove the entry is wrong.

Can a command still run when the tilde was not expanded?

Yes. Disconnect3d demonstrated a command running from a directory literally named `~` beneath the current directory. That is different from running it from the home directory.

Source: hn

You May Also Like

Doory – Open-Source Canva

Doory is an open-source, browser-based design editor with no-cost features, guest access and self-hosting. Its feature and security claims are project-stated.

Prioritization Frameworks: MoSCoW and More for Focused Innovation

Jumpstart your project focus with prioritization frameworks like MoSCoW—discover how they can transform your innovation process and why they matter.

Affinity Mapping: Turning Research Findings Into Insightful Clusters

Learning how to cluster research insights with affinity mapping reveals powerful patterns that can transform your understanding—discover how to unlock hidden opportunities.

Best Software Testing Tools For Developers Compared

Compare Playwright and Cypress on browser coverage, debugging, setup, CI, and cost to choose the right end-to-end testing tool for your team.