Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3999

Allow EDITOR for shell's edit command to be set in JavaScript

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1.1
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • Environment:
      Any that supports the shell's "edit" feature
    • Fully Compatible

      Just a suggestion. It's great that we let the user specify what editor to use to edit JavaScript objects in the shell, but it's less great that we REQUIRE them to specify the editor. The problem is that by the time you see the message, it is too late. You would have to exit the shell and restart it to edit the object you just created. And the object won't be there unless you create it again,

      MongoDB shell version: 2.1.0-pre-
      connecting to: test
      > f={}
      { }
      > edit f
      please define the EDITOR environment variable
      >

      Nobody much likes Windows NotePad, but it works and would get the job done. On Linux, perhaps we could run vi or emacs and I forget the name of the Mac default editor but there is one. This value would only be used in the case where EDITOR is not defined, so we could change the message to

      the EDITOR environment variable is not defined, defaulting to vi

            Assignee:
            tad Tad Marshall
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: