garybernhardt/selecta

Suggested vim function does not work on MacVim

Closed this issue · 2 comments

dlee commented

When following the instructions on the README for using selecta with vim, I get the following error when using MacVim:

E79: Cannot expand wildcards
"~/bin/selecta:546:in `initialize': Device not configured - /dev/tty (Errno::ENXIO)" [New DIRECTORY]
Error detected while processing function SelectaCommand:
line   10:
E492: Not an editor command: ^Ifrom /Users/dlee/bin/selecta:546:in `open'^@^Ifrom /Users/dlee/bin/selecta:546:in `with_tty'^@^Ifrom /Users/dlee/bin/selecta:321:in `with_screen'^@^Ifrom /Use
rs/dlee/bin/selecta:36:in `main'^@^Ifrom /Users/dlee/bin/selecta:586:in `<main>'^@

When you say MacVim, I assume that you mean the graphical OS X app? If so, this is no surprise: Selecta can only run in a full ANSI terminal, and MacVim doesn't provide one. This is manifesting as /dev/tty not being present, but even if we didn't rely on that it still wouldn't work: you'd see a bunch of raw ANSI escape codes spewed onto the screen. This is going to be true of any interactive tool, which is one of the reasons that I recommend against graphical vims.

I just added a note to the README to clarify this. I also added #32 to fail in a more obvious way. If my assumption was wrong and you're running Vim inside a terminal, feel free to reopen this issue and we can dig into it a bit more. Thanks!

dlee commented

You were spot on, thanks!