xianzhon / vim-code-runner

Similar code-runner plugin for vim
The Unlicense
13 stars 6 forks source link

Error with zsh and bash #5

Closed joselbr2099 closed 3 months ago

joselbr2099 commented 2 years ago

When I try to run code(python, Golang, bash scripts etc.), I get this error using bash:

/bin/bash: ++: invalid option
Usage:  /bin/bash [GNU long option] [option] ...
        /bin/bash [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --pretty-print
        --rcfile
        --restricted
        --verbose
        --version
Shell options:
        -ilrsD or -c command or -O shopt_option         (invocation only)
        -abefhkmnptuvxBCHP or -o option

[Process exited 2]

and with zsh:

zsh: bad option: -+

[Process exited 1]

my neovim version:

nvim -v
NVIM v0.6.0-dev+646-g6e70b7b31
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/nvim/parts/nvim/build/build/config -I/build/nvim/parts/nvim/build/src -I/build/nvim/parts/nvim/build/.deps/usr/include -I/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include
Compiled by root@lgw01-amd64-020

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
xianzhon commented 2 years ago

@joselbr2099 Hi, could you share the script file (eg. bash, python) you are using? Or you can just check whether the plugin has problem for below simple test script?

test_bash.sh file content:

echo "Hello bash!"
joselbr2099 commented 2 years ago

Hi @xianzhon. The error happens in multiple scripts, here the simple echo "Hello bash!" code

simple

same result with

#!/bin/bash
echo "Hello bash!"

or

#!/bin/zsh
echo "Hello bash!"

en my init.vim set:

set shell=/usr/bin/bash
or
set shell=/usr/bin/zsh

and the result is te same error

xianzhon commented 2 years ago

@joselbr2099 Sorry for the late reply. It seems nvim's terminal emulator uses different command format. I will check and fix it today. Thanks for reporting.