github / github/copilot-cli

Feature Request: Persist /add-dir allowed directories across sessions

Abierto
#2,284 3 comentarios 17 reacciones 0 asignados Ver en GitHub
area:permissions
Lenguaje dominante
Shell
Estrellas
11.2k
Forks
1.9k
Merge medio
14 h 16 min
PR fusionados (30 d)
6

Descripción

## Feature Request

### Summary
The `/add-dir` command adds directories to the allowed list for file access, but these permissions are **session-scoped only** and are lost when the session ends. There is no built-in way to persist allowed directories across sessions.

### Current Behavior
- `/add-dir ` adds a directory to the allowed list for the current session
- `/list-dirs` shows the allowed directories for the current session
- After restarting Copilot CLI (even with `/restart`), all added directories are gone

### Expected Behavior
Users should be able to mark directories as **permanently trusted**, so they appear automatically in `/list-dirs` on every new session without needing to re-add them each time.

### Proposed Solution
- Add a `/add-dir --permanent` (or `/add-dir --global`) flag to persist directories in `~/.copilot/config.json`
- Add a corresponding `/remove-dir ` command to revoke persistent access
- `/list-dirs` should show both session-scoped and persistent directories (with a label distinguishing them)

### Use Case
When working with directories on a Windows host via WSL (e.g. `/mnt/c/Users/paolo/git/myproject`), users need to re-add the same directories at the start of every Copilot session, which is repetitive and breaks workflow.

### Workaround
Currently none — `trusted_folders` in `config.json` serves a different purpose (workspace trust for MCP server loading) and does not affect `/list-dirs`.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.