cli / cli/cli

gh cs cp remote: does not resolve remote paths unless `-e` flag is provided

Aperta
#11,712 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug gh-codespace priority-2
Lingua principale
Go
Stelle
46.3k
Fork
9k
Merge medio
2g 6h
PR unite (30g)
97

Descrizione

### Describe the bug

If I run this:

```shellsession
$ gh cs cp -c ominous-space-journey-wv6jg4qrqh5xqq remote:/workspaces/github/Gemfile Gemfile
/usr/bin/scp: '/workspaces/github/Gemfile': No such file or directory
shell closed: exit status 1
```

I know the file exists, though. In order to copy it, instead I need to run this:

```
$ gh cs cp -e -c ominous-space-journey-wv6jg4qrqh5xqq remote:/workspaces/github/Gemfile Gemfile
/usr/bin/scp: '/workspaces/github/Gemfile': No such file or directory
shell closed: exit status 1
```

The help for `cs cp` describes the `-e` flag as "-e, --expand Expand remote file names on remote shell" which in my mind, at least, means expanding `~` and environment variables. However, I am providing absolute paths with no variables.

### Affected version

```shellsession
$ gh version
gh version 2.76.2 (2025-07-30)
https://github.com/cli/cli/releases/tag/v2.76.2
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reproducing the reported behavior through the `gh cs cp` entry point with an absolute `remote:` path, both with and without `--expand`. Trace how the command passes remote paths to scp; done means absolute remote paths resolve without requiring `--expand`, while expansion of `~` and environment variables still works.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.