Skip to content

Expand leading variables in the location bar - #1930

Open
sean-v8 wants to merge 1 commit into
mate-desktop:masterfrom
sean-v8:location-env-vars
Open

sean-v8 wants to merge 1 commit into
mate-desktop:masterfrom
sean-v8:location-env-vars

Conversation

@sean-v8

@sean-v8 sean-v8 commented Nov 21, 2026

Copy link
Copy Markdown

Typing $GIT in the location bar currently treats it as a relative filename. Expand leading $NAME and ${NAME} variables, with optional path suffixes, before resolving the location. Completion retains the variable spelling in the entry.

Use the inherited environment first. For missing or empty values, query interactive Bash asynchronously so definitions in .bashrc and sourced .bash_aliases work too. Shell startup files execute normally; the location text is never evaluated as shell code. Each lookup uses a separate session, supports cancellation, and has a three-second timeout.

Undefined or empty variables use Caja's existing error wording and retain the typed variable in the dialog. Ordinary paths and URLs retain their existing handling; ./$NAME can address a literal filename.

Validation:

  • Built and manually tested on Ubuntu MATE 26.04, including completion, focus changes, paths with spaces, and unresolved-variable errors.
  • Eight automated test groups cover parsing, environment precedence, Bash startup output, completion, detached sessions, missing Bash, cancellation, and timeout.
  • Helper tests also pass with AddressSanitizer and UndefinedBehaviorSanitizer (leak detection disabled because of the test runtime).

Support leading $NAME and ${NAME} paths with directory completion. Resolve missing environment values through cancellable, detached Bash lookups and preserve the standard error dialog for unresolved variables.

This branch has not been deployed

No deployments
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.

1 participant