Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac vim excess characters bug fix #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lewesche
Copy link

Potential fix for issue #137 with random chars from vim on mac, helpful failure for -c without a file, added CTRL+O to README

I saw the same error on a similar Mac. I experimented a bit and I don't think this is related to the gocui library. Seems to have something to do with .vimrc settings causing vim to spit out weird data into stdout after shutdown:
https://stackoverflow.com/questions/51129631/vim-8-1-garbage-printing-on-screen

Tough to ensure users have a good .vimrc, but one solution is to just not use the .vimrc if the editor is set to vim on a mac:

var cmd *exec.Cmd if editor == "vim" && runtime.GOOS == MAC_OS { cmd = exec.Command(editor, "-u", "NONE", file.Name()) } else { cmd = exec.Command(editor, file.Name()) }

Not ideal but works. I also added a helpful failure message for running the -c flag and no file, rather than a seg fault.

@lewesche lewesche changed the title Mac vim excess characters bug fix #137 Mac vim excess characters bug fix Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant