Skip to content

Add subcommand to gp CLI for detecting if the command was run from Web-VSCode or Desktop-VSCode or other #11969

Closed
@axonasif

Description

@axonasif

Is your feature request related to a problem? Please describe

Such a shorthand subcommand would be useful for a use case such as:

  • On web, your webserver root address is something
  • But on desktop it may/could be different.
    So you could run something like gp which ide inside a script and decide upon the result to modify your environment.

Describe the behaviour you'd like

gp which ide tells you the IDE name.

Describe alternatives you've considered

if {
      pgrep -f 'sshd: gitpod@notty' \
        || pgrep -f "$HOME/.vscode-server/bin" \
        || test -e "$HOME/.ssh/authorized_keys";
} 1>/dev/null; then {
  printf '%s\n' "Gitpod on desktop";
  : "http://localhost:3000";
} else {
  printf '%s\n' "Gitpod on da web";
  : "$(gp url 3000)";
} fi

export HMR_HOST="$_"

Additional context

Please see these discord threads:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions