profclems / glab

The GitLab CLI tool. Archived: now officially adopted by GitLab as the official CLI tool and maintained at https://gitlab.com/gitlab-org/cli. See https://github.com/profclems/glab/issues/983
https://glab.readthedocs.io/
MIT License
2.08k stars 163 forks source link

Failure to open editor if that is an alias #992

Open ssbarnea opened 2 years ago

ssbarnea commented 2 years ago

Description

glab fails to open user EDITOR=foo if foo is defined as an alias. That is because it wrongly assumes that this must be an executable.

Expected Behavior vs Actual Behavior

Use shell to run editor instead of trying to execute it as a command.

Current behavior break for at least two use cases: aliases and shell functions. On both, it will fail to start the tesit.

Possible Fix

Steps to Reproduce

  1. Type this '...'
  2. View the output '....'
  3. See error

Logs

? Description [(e) or Enter to launch edit, (s) or Esc to skip] exec: "edit": executable file not found in $PATH

Your Environment

ssbarnea commented 2 years ago

To make situation even worse it seems that the options to reconfigure it do not work, mainly commands report success but editor is not changed:

ssbarnea@m1: ~/c/a/cci-config fix/ansible
$ glab config set -g editor 'code -r -a'

ssbarnea@m1: ~/c/a/cci-config fix/ansible
$ glab config get editor                 
edit

cat  ~/.config/glab-cli/config.yml | grep editor
editor: !!null code -r -a

Now we know why...

ssbarnea commented 2 years ago

I only gets better... I manually updated the config to change the editor and it still reports edit. I am clueless regarding where this value is coming from. I guess that my only chance is to create wrapper edit script and put it in path.

clemsbot commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. We haven't had the time to address it yet, but we want to keep it open. This message is just a reminder for us to help triage issues.