[vim/vim] feat(has): add support for 'android' and 'termux' feature flags (PR #19623)

14 views
Skip to first unread message

TomIO

unread,
Mar 9, 2026, 9:07:17 PM (3 days ago) Mar 9
to vim/vim, Subscribed

Problem: The 'android' and 'termux' feature flags have been shipped in Termux's downstream vim/vim-gtk package for 5+ years but were never properly documented in the downstream patch.

Solution: Upstream the 'android' and 'termux' feature flags into Vim as decoupled feature flags, this enables the 'android' feature in particular to be available independently of the 'termux' feature for builds of Vim against the Android NDK, but not including the Termux NDK patchset.

Additional context:

This PR is an upstreaming effort based on an existing downstream patch for Vim in Termux.
https://github.com/termux/termux-packages/blob/4f5d80b/packages/vim/src-evalfunc.c.patch

Note

  • An equivalent PR has been submitted by me to Neovim to upstream the neovim equivalent of this downstream patch as well.
    Neovim PR: neovim/neovim#38218

I have added two additional authors to the attached commit:
@shadmansaleh as the author of the original downstream patch for Termux's Vim/Vim-GTK package, which this PR is based on.
and @lethal-lisa who initially made me aware of the lack of documentation and helped with research for the revised patch.

This is my first time making a pull request to Vim, I have tried to the best of my ability to follow all contribution guidelines, if I've goofed up significantly anywhere or missed something please let me know and I'll get that resolved as soon as I can.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19623

Commit Summary

  • 0b50423 feat(has): add support for 'android' and 'termux' feature flags

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623@github.com>

TomIO

unread,
Mar 9, 2026, 9:42:11 PM (3 days ago) Mar 9
to vim/vim, Subscribed
TomJo2000 left a comment (vim/vim#19623)

Whoops, I'm doing some nervous post-submission checking right now and I'm pretty sure I misinterpreted what winds up as a +feature in e.g. :version.
has('linux'), has('termux') and has('android') do not show up in there.
And +linux isn't showing up in :version on my PC's vim either.

So those help tags should have been *android* and *termux* instead of *+android* and *+termux*


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/c4028024654@github.com>

TomIO

unread,
Mar 9, 2026, 9:52:16 PM (3 days ago) Mar 9
to vim/vim, Push

@TomJo2000 pushed 1 commit.

  • fd126ff feat(has): add support for 'android' and 'termux' feature flags


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/before/0b50423efda7776dc6fd3bf0c584fa42c8a92467/after/fd126ff6493cf6aa19e26f03936fdad9a4c5fa4c@github.com>

TomIO

unread,
Mar 10, 2026, 10:12:18 AM (2 days ago) Mar 10
to vim/vim, Push

@TomJo2000 pushed 1 commit.

  • 54bb1b5 feat(has): add support for 'android' and 'termux' feature flags

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/before/fd126ff6493cf6aa19e26f03936fdad9a4c5fa4c/after/54bb1b5f3cc7b7edadcd936ecc82041bb90091a7@github.com>

TomIO

unread,
Mar 10, 2026, 10:16:11 AM (2 days ago) Mar 10
to vim/vim, Subscribed
TomJo2000 left a comment (vim/vim#19623)
  • As pointed out in the Neovim PR (neovim/neovim#38218 (comment))
    the list of has() features is sorted alphanumerically, which I hadn't accounted for when initially submitting this patch for upstreaming since the original downstream patch added the "android" and "termux" features unconditionally to the end of the list.

I have corrected this now.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/c4031707893@github.com>

Christian Brabandt

unread,
Mar 10, 2026, 3:33:04 PM (2 days ago) Mar 10
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19623)

thanks, makes sense. But what is the reason for termux? I can understand android, but google tells me termux is a terminal emulator for Android? Why would we need a compiled feature flag for a runtime thing?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/c4033925603@github.com>

TomIO

unread,
Mar 10, 2026, 4:31:04 PM (2 days ago) Mar 10
to vim/vim, Subscribed
TomJo2000 left a comment (vim/vim#19623)

Termux is a terminal app and packaging environment for Android.
There's a large overlap with base Android in terms of tooling and "envrionment personality".
(for lack of me having a better term for it on my mind).
Termux is distinct in that we add a significant amount of additional compatibility tweaks into the Android NDK toolchain to make it behave closer to a standard desktop Linux environment.

Conceptually the closest widely used equivalents would be something like Cygwin, MSys2 or WSL.
Not quite Linux, but distinct from Windows itself.
Termux fills a similar niche on Android to provide a more desktop Linux like software environment for application.
Hence has("android") and has("termux") aren't necessarily synonymous.

We have shipped a version of this patch downstream in our vim and vim-gtk packages for over 5 years due to popular demand.

A has("termux") feature could be substituted by e.g. has("android") && has_key(environ(), 'TERMUX__PID').
But that would break backwards compatibility for our existing users relying on it unless we retain a downstream patch to add a has("termux") feature if this is deemed unsuitable for inclusion in upstream.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/c4034262295@github.com>

Christian Brabandt

unread,
Mar 11, 2026, 4:44:12 PM (20 hours ago) Mar 11
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19623)

I see, thanks


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19623/c4042089868@github.com>

Reply all
Reply to author
Forward
0 new messages