lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
365 stars 19 forks source link

Unrecognised option in busybox #97

Closed night0721 closed 3 months ago

night0721 commented 3 months ago

I am using Alpine Linux with busybox coreutils, and whenever I start nvimpager, I get this

Error detected while processing pre-vimrc command line:
E5108: Error executing lua ...ht/.local/share/nvimpager/runtime/lua/nvimpager/init.lua:47: Error executing lua: vim/_editor.lua:0: command failed: ['ps', '-p', 3457, '-o', 'comm=']
stack traceback:
        [C]: in function 'error'
        vim/_editor.lua: in function <vim/_editor.lua:0>
        [C]: in function 'nvim_get_proc'
        ...ht/.local/share/nvimpager/runtime/lua/nvimpager/init.lua:47: in function 'detect_parent_process'
        ...ht/.local/share/nvimpager/runtime/lua/nvimpager/init.lua:169: in function 'stage1'
        [string ":lua"]:1: in main chunk
stack traceback:
        [C]: in function 'nvim_get_proc'
        ...ht/.local/share/nvimpager/runtime/lua/nvimpager/init.lua:47: in function 'detect_parent_process'
        ...ht/.local/share/nvimpager/runtime/lua/nvimpager/init.lua:169: in function 'stage1'
        [string ":lua"]:1: in main chunk

Then I went to check the ps command

ps: unrecognized option: p
BusyBox v1.36.1 (2024-03-24 07:55:18 UTC) multi-call binary.

Usage: ps [-o COL1,COL2=HEADER] [-T]

Show list of processes

        -o COL1,COL2=HEADER     Select columns for display
        -T                      Show threads

Is there anything I could do? As it seems that is a default function from nvim.

Thanks. Night

lucc commented 3 months ago

As the error happens inside nvim_get_proc you could try to report this problem upstream (I was able to fix another incompatibility with alpine some time ago: https://github.com/neovim/neovim/pull/8860). Maybe it is worth a try to add an alpine test for nvim_get_proc upstream.

In the mean time you can try to install gnu coreutils on your alpine system. I can not think of a way to work around this in nvimpager.