code: def get_editor_cmd_from_environment():
      
      result = os.getenv(ENV_VISUAL)
      if (not result):
          result = os.getenv(ENV_EDITOR)
      return result
docs: Gets and editor command from environment variables.
  
      It first tries $VISUAL, then $EDITOR, following the same order git uses
      when it looks up edits. If neither is available, it returns None.