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

[Bug]: neovim "Man" command is broken by termux patch #16720

Closed
ajpaon opened this issue May 19, 2023 · 4 comments · Fixed by #16821
Closed

[Bug]: neovim "Man" command is broken by termux patch #16720

ajpaon opened this issue May 19, 2023 · 4 comments · Fixed by #16821
Labels
bug report Something is not working properly.

Comments

@ajpaon
Copy link

ajpaon commented May 19, 2023

Problem description

Neovim provides a plugin for viewing man pages in the editor. It's broken in termux, and I'll explain why.

The plugin works by using the man command to find the path to the man file.

When neovim was updated to 0.9 on termux, a change was made to this patch: packages/neovim/runtime-lua-man.lua that causes the plugin to use mandoc to find the file path.

ebeb10f

So now, instead of running (for example)

$ man -w man
/data/data/com.termux/files/usr/share/man/man1/man.1.gz
/data/data/com.termux/files/usr/share/man/man7/man.7.gz

We do

$ mandoc -w man
mandoc: man: BADARG: bad command line argument: No such file or directory

This error message is swallowed by the lua plugin - it really took some dedicated debugging to find the cause!

When I manually revert this change and use man instead of mandoc, the plugin works again.

It's not at all clear to me what the rationale for using mandoc here was. It's not mentioned in the commit and it's not explained in the comment change. I think it was probably an accident; AFAICT no version of mandoc supports the -w switch.

What steps will reproduce the bug?

Running this command in neovim

:Man strace

Results in the error

man.lua: "no manual entry for strace"

This is reproducible starting from nvim -u NORC, which runs neovim without my custom config.

On the other hand, running man strace in bash works fine.

What is the expected behavior?

The man page should open

System information

termux-info:

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=9706
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main stable main
Updatable packages:
clang/stable 16.0.4 aarch64 [upgradable from: 16.0.3]
curl/stable 8.1.0 aarch64 [upgradable from: 8.0.1]
dos2unix/stable 7.5.0 aarch64 [upgradable from: 7.4.4]
dpkg/stable 1.21.22 aarch64 [upgradable from: 1.21.21]
fribidi/stable 1.0.13 aarch64 [upgradable from: 1.0.12]
golang/stable 3:1.20.4-1 aarch64 [upgradable from: 3:1.20.4]
libcompiler-rt/stable 16.0.4 aarch64 [upgradable from: 16.0.3]
libcurl/stable 8.1.0 aarch64 [upgradable from: 8.0.1]
libllvm/stable 16.0.4 aarch64 [upgradable from: 16.0.3]
libmpfr/stable 4.2.0-p9-0 aarch64 [upgradable from: 4.2.0-p7-0]
librav1e/stable 0.6.6 aarch64 [upgradable from: 0.6.5]
libsqlite/stable 3.42.0 aarch64 [upgradable from: 3.41.2]
libxml2/stable 2.11.4 aarch64 [upgradable from: 2.11.3]
lld/stable 16.0.4 aarch64 [upgradable from: 16.0.3]
llvm/stable 16.0.4 aarch64 [upgradable from: 16.0.3]
sqlite/stable 3.42.0 aarch64 [upgradable from: 3.41.2]
termux-tools version:
1.38.1
Android version:
13
Kernel build information:
Linux localhost 5.4.147-qgki-25884040-abT733XXU2CWC5 #1 SMP PREEMPT Thu Mar 30 20:32:41 KST 2023 aarch64 Android
Device manufacturer:
samsung
Device model:
SM-T733
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@ajpaon ajpaon added bug report Something is not working properly. untriaged labels May 19, 2023
@xtkoba
Copy link
Contributor

xtkoba commented May 19, 2023

The commit was "branched" from neovim-nightly package. The actual change was made in 7137f6d. Still no description though.

@ajpaon
Copy link
Author

ajpaon commented May 19, 2023

Thanks @xtkoba. I think it's a bug in both places :)

I just installed neovim-nightly and reproduced it there too

@licy183 licy183 removed the untriaged label May 20, 2023
@ajpaon
Copy link
Author

ajpaon commented Jun 1, 2023

may I send a PR to fix this patch?

@Grimler91
Copy link
Member

may I send a PR to fix this patch?

Please go ahead

ajpaon pushed a commit to ajpaon/termux-packages that referenced this issue Jun 2, 2023
These patches break neovim's ability to find manpages

Fixes termux#16720
xtkoba pushed a commit that referenced this issue Jun 3, 2023
These patches break neovim's ability to find manpages

Fixes #16720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants