Skip to content

/add-dir works with ~ but not $HOME for home directories #144

@mxie

Description

@mxie

Describe the bug

$HOME is a commonly used to refer to the home directory, and I referred to it when trying to add a directory to the allow list. However, Copilot CLI doesn't seem to know how to expand it the same way it does for ~. As a result, the directory was not successfully added to the allow list despite /add-dir saying it was "added" which was misleading.

CleanShot.2025-09-30.at.12.58.mp4

Affected version

0.0.330; Commit: a8bfefe

Steps to reproduce the behavior

  1. Run /add-dir with a path that refers to $HOME (or maybe any variable)
    • You should see: Added directory to allowed list: <path with variable in raw form>
  2. Run /list-dirs
    • You should see: new path not listed

Expected behavior

A few possibilities here, but the gist is that I would've expected any behavior that was clear about what worked / what didn't. For example:

  1. The new path to be added (in raw or expanded form)
  2. A successful message was not shown when the path wasn't actually added
  3. Support for tab-completion so that the path can be auto-expanded, increasingly the likelihood of it being added successfully

Additional context

  • macOS on ARM
  • iTerm2
  • zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions