diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index e0cd2c1fd..8be480f4f 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -115,9 +115,13 @@ EOT { // Open file in editor if ($input->getOption('editor')) { - // @todo Find a way to use another editor - $editor = system("bash -cl 'echo \$EDITOR'"); - system($editor . ' ' . $this->configFile->getPath() . ' > `tty`'); + $editor = getenv('EDITOR'); + if (!$editor) { + $editor = defined('PHP_WINDOWS_VERSION_BUILD') ? 'notepad' : 'vi'; + } + + system($editor . ' ' . $this->configFile->getPath() . (defined('PHP_WINDOWS_VERSION_BUILD') ? '': ' > `tty`')); + return 0; }