Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1097

Attempting to start editor fails with 'unexpected token' error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.1
    • Affects Version/s: 1.1.6
    • Component/s: Embedded Shell
    • None
    • Environment:
      mac OS 11.6.2
      mongosh 1.1.6
    • 2
    • Not Needed
    • Iteration Xochimilco, Iteration Yonkers

      Problem Statement/Rationale

      What is going wrong? What action would you like the Engineering team to take?

      The editor fails to edit the buffer when the editor is set to 'vi'

      ```

      $ edit

      Opening an editor...

      /bin/sh: -c: line 0: syntax error near unexpected token `('

      /bin/sh: -c: line 0: `vi edit-ObjectId("61e5db91025954908da142fd").js'

      ```

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      • set editor, i.e. `config.set( "editor", "vi" )`
      • have a valid query in the buffer
      • attempt to edit query in buffer, i.e. `edit`

      I see the same outcome when setting the editor to 'vim'. 

      NOTE : both 'vi' and 'vim on available on host

      {{$ which vi
      }}/usr/bin/vi

      {{$ which vim
      }}/usr/bin/vim

      ```

      Expected Results

      What do you expect to happen?

      'vi' is launched with contents of the buffer

      Actual Results

      What do you observe is happening?

      An invalid filename is produced 

      Additional Notes

      Any additional information that may be useful to include.

        1. 61e5b358025954908da142fb_log
          210 kB
        2. 61e83345054cad0fb058299b_log
          118 kB

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            steve.hand@ukg.com Steven Hand
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: