termuxenv

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package termuxenv prepares a PiG process for Termux on Android.

Termux has no /etc and no /tmp. PiG's Android build links the C library (cgo), so Go resolves names through bionic and trusts Android's system certificates. This package sets the defaults Termux's own tools use, and gives a build without cgo the resolver configuration Go cannot find: without cgo Go's resolver falls back to the name servers 127.0.0.1 and ::1 and every lookup fails (golang/go#8877).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure()

Configure adapts the process to Termux and does nothing elsewhere. Call it before the first network request or temporary file. It

  • sets TMPDIR to $PREFIX/tmp when it is unset, as Termux's profile does;
  • sets SSL_CERT_FILE to Termux's CA bundle when it is unset, so TLS trusts the same certificates as Termux's own tools;
  • without cgo, replaces net.DefaultResolver with one that reads $PREFIX/etc/resolv.conf when /etc/resolv.conf is missing.

func IsTermux

func IsTermux(getenv func(string) string) bool

IsTermux reports whether the process runs in Termux, which sets TERMUX_VERSION. Pi's clipboard and TUI code detect Termux the same way.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL