fox0430 / moe

A command line based editor inspired by Vim. Written in Nim.
https://editor.moe
GNU General Public License v3.0
651 stars 34 forks source link

Moe crashes when using `:!` to run a command #2043

Closed xTrayambak closed 5 months ago

xTrayambak commented 5 months ago

Version

moe v0.3.0

Git hash: 4441ff7dd7baa5f2f423527d0fceb6adc7bdc311
Build type: Debug

Environment

NixOS 24.05 (Linux 6.8.1), Foot terminal

Category

Major — The software does not fulfill the task it is designed for.

Steps to Reproduce

  1. Build moe and run it
  2. Enter COMMAND mode and type in :!echo. As soon as you press spacebar and another character, moe crashes.

Detailed Description

                                                            /home/tray/Documents/Projects/moe/src/moe.nim(29) main
                                                                                                                  /home/tray/Documents/Projects/moe/src/moepkg/mainloop.nim(908) editorMainLoop
    /home/tray/Documents/Projects/moe/src/moepkg/mainloop.nim(644) commandLineLoop
                                                                                  /home/tray/Documents/Projects/moe/src/moepkg/mainloop.nim(463) updateCompletionWindowBufferInCommandLine
                                                                                                                                                                                          /home/tray/Documents/Projects/moe/src/moepkg/commandlineutils.nim(194) initExmodeCompletionList
                                                                                              /home/tray/Documents/Projects/moe/src/moepkg/commandlineutils.nim(152) getExCommandOptionCompletionList
          /home/tray/.nimble/pkgs2/results-0.4.0-f5971c64ccb600d34df5a162cad32e262f8d84f9/results.nim(388) value
                                                                                                                /home/tray/.nimble/pkgs2/results-0.4.0-f5971c64ccb600d34df5a162cad32e262f8d84f9/results.nim(376) raiseResultDefect
                                       Error: unhandled exception: Trying to access value with err Result: Invalid command [ResultDefect]

The output is badly formatted as moe itself messes with it (or does ncurses?)

fox0430 commented 5 months ago

@xTrayambak

Thank you for your bug report. This cause is command parsing and currently, moe doesn't support !echo. Please use ! echo. But in the future, !echo may be supported.