Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@offbyone

Description

@offbyone

Describe the bug

If I run this:

$ 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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageneeds to be reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions