akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.4k stars 62 forks source link

Command line options do not work in windows #335

Closed shiena closed 8 months ago

shiena commented 2 years ago

OS: Windows10 goneovim: nightly-1-gaeea7ae

image

However, it is possible to open the file specified in the argument.

shiena commented 2 years ago

This setting seems relevant.

shiena commented 2 years ago

The windows build uploaded to the following URL was output to the console. https://github.com/akiyosi/goneovim/actions/runs/2149147269 image

akiyosi commented 2 years ago

@shiena Thanks for the quick confirmation. Closed.

akiyosi commented 2 years ago

It seems that enabling QT_DEBUG_CONSOLE launches a console window in addition to the GUI window. There may need to be a way to suppress this or another mechanism to display application help, version information, etc. neovim-qt seems to have achieved this with its own widget.

shiena commented 2 years ago

I think it's okay to revert this commit. https://github.com/akiyosi/goneovim/commit/939f78d2151cf27d1cad434cd1ae5524b0729159

shiena commented 1 year ago

@akiyosi I ran goneovim --help from within Goneovim and got the output. So, I created a script to display it in a float window. Probably, if you execute the command directly without using the shell, the help will be outputted.

function! GonvimUsage() abort
    let pid=nvim_get_proc(nvim_get_proc(nvim_get_proc(getpid()).ppid).ppid).pid
    let output = systemlist("wmic process where processid=" . pid . " get executablepath")
    let gonvimpath = trim(output[1])

    let output = systemlist(gonvimpath . ' --help')
    let width = 0
    for line in output
        let length = strlen(line)
        if length > width
            let width = length
        endif
    endfor
    let height = len(output)
    let opts = {
                \ 'width': width + 1,
                \ 'height': height,
                \ 'anchor': 'NW',
                \ 'style': 'minimal'
                \ 'external': v:true
                \ }
    let buf = nvim_create_buf(v:false, v:true)
    let win = nvim_open_win(buf, v:true, opts)
    call nvim_buf_set_lines(buf, 0, -1, v:true, output)
endfunction
command! GonvimUsage call GonvimUsage()
image
akiyosi commented 1 year ago

@shiena Nice! It might be a good idea to add this command as a Windows-only default.

shiena commented 1 year ago

@akiyosi I don't know why, but I was able to output the help to the console with the following command.

goneovim --help | more

# for PowerShell
goneovim --help | Out-Host
# or
goneovim --help | Out-Default