termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
31.28k stars 3.32k forks source link

[Bug]: Android 14 causing all kinds of issues #3855

Closed GR3YH4TT3R93 closed 2 months ago

GR3YH4TT3R93 commented 2 months ago

Problem description

The first issue started with backslashes in scripts that worked previously (android 13) are mangled on android 14 e.g.

if [[ $old_style =~ '\e\][0-9]+;.+\a' ]]; then Used to work on Android 13 but now requires:

if [[ $old_style =~ '\\e\][0-9]+;.+\\a' ]]; then and after updating, language servers for nvim that were installed via Mason are no longer able to be spawned with the error:

"Spawning language server with cmd: /data/data/com.termux/files/home/.local/share/nvim/mason/bin/tailwindcss-language-server failed. The language server is either not installed, missing from PATH".

I have a feeling that these issues are related but I don't have the experience or knowledge of what's going on to say for sure. I tried adding the mason/bin directory to PATH via

export MASON_HOME="/data/data/com.termux/files/home/.local/share/nvim/mason/bin" case ":$PATH:" in *":MASON_HOME:"*) ;; *) export PATH="$MASON_HOME:$PATH" ;; esac

with no success

Steps to reproduce the behavior.

1.) Install Termux on Android 14 device

2.) Install git, zsh

3.) Clone zsh-vi-mode via git clone https://github.com/jeffreytse/zsh-vi-mode.git $HOME/.zsh-vi-mode

4.) Source the plugin in .zshrc via source $HOME/.zsh-vi-mode/zsh-vi-mode.plugin.zsh

5.) Restart Termux or source .zshrc

6.) hit enter. Will get an error about trailing backslashes

7.) Install neovim

8.) Install and setup Mason, mason-lspconfig, and nvim-lspconfig, plugins

9.) Open file that has a supported lsp server from Mason.

10.) you should see the error provided in the description above.

What is the expected behavior?

The zsh-vi-mode plugin to work wothout modifications and LSP servers to be spawned like they were on android 13

System information

s1mp7e commented 2 months ago

I have the same problem. Also Android 14 and OnePlus phone. Neovim does not work with language servers installed from npm. The server location path is determined correctly. But it feels like he doesn't see links to the servers' executable files. Language servers work if you run them from the command line.

agnostic-apollo commented 2 months ago

Install termux-exec deb from end of following and see if execution gets fixed.

https://github.com/termux/termux-exec/pull/24#issuecomment-1873059748

GR3YH4TT3R93 commented 2 months ago

@agnostic-apollo it fails with the following error:

curl -o ~/te-997.deb https://fornwall.me/te-997.deb && apt install --reinstall ~/te-997.deb % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 15 100 15 0 0 4 0 0:00:03 0:00:03 --:--:-- 4 Reading package lists... Error! E: Invalid archive signature E: Internal error, could not locate member control.tar{.zst,.lz4,.gz,.xz,.bz2,.lzma,} E: Could not read meta data from /data/data/com.termux/files/home/te-997.deb E: The package lists or status file could not be parsed or opened.

agnostic-apollo commented 2 months ago

There is termux-exec.zip attached to my comment, download and extract that.

s1mp7e commented 2 months ago

Install termux-exec deb from end of following and see if execution gets fixed.

termux/termux-exec#24 (comment)

My problem is solved. Thank you very much.

GR3YH4TT3R93 commented 2 months ago

My bad, solved my problem as well! Tysm!

agnostic-apollo commented 2 months ago

Welcome both.

agnostic-apollo commented 2 months ago

And escaping backslashes in regexes is normally required.

GR3YH4TT3R93 commented 2 months ago

That's strange.. I wonder why it's not an issue for most people, the example above is a snippet from jeffreytse/zsh-vi-mode that's causing me and others issues only on android 14. Did they "fix" a "bug" pertaining to escaped backslashes or something?

agnostic-apollo commented 2 months ago

There would be conflicting behavior with newline \n and others not requiring an escape, vs sequences not being special like \a. Makes sense to mandate escaping for the later.

agnostic-apollo commented 2 months ago

\n would be in bracket though. However...

The interpretation of an ordinary character preceded by an unescaped ( '\' ) is undefined, except in the context of a bracket expression.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04