Skip to main content

TermuxC

Termux Copy To Clipboard Made simple.

Also known as TermuxCopy

License: MIT Python Version PyPI version PyPI downloads

This dual function pip package & cli tool was made to solve an issue with Termux, not allowing copying to device clipboard easily without their companion app; This package solves that.

Table of Contents

Why use TermuxC?

  • Allows coping from files or text using OSC52
  • Allows piping data
  • Requires Zero external dependencies; no extra pip packages required
  • Designed specifically to work on Termux
  • Termux API app is not required

Installation

Install using pip

pip install TermuxC

Install using git

git clone https://github.com/Ruizennis/TermuxC
cd TermuxC

Quick Start

Once you install TermuxC you can start easily copying text using the termuxc command.

termuxc hi!

This will copy "hi!" to your device clipboard.

Cli Tool Usage:

Copy text

termuxc text

Or

echo "test" | termuxc

Copy text from file

cat filename | termuxc

Copy text from file using the read from file flag

termuxc -f filename

Copy current working directory

pwd | termuxc

Also compatible with

  • bat
  • grep
  • curl
  • head
  • tail
  • ls

And other stdin based cli tools!

Pip package Usage:

Copy text

from TermuxC import copy
copy("Str") # works with strings,
copy(1) # numbers,
copy(1.3) # and floats!

Copy text from file

from TermuxC import copy
with open("filename", "r") as f:
    content = f.read()
    copy(content)

Copy current working directory

from TermuxC import copy
import os
copy(os.getcwd())

Flags

Flag Function
-f Read from file
-i Interactive mode
-v Enable verbose output
-h Show help menu
-V Show package version

Additional flag aliases

  • --file
  • --interactive
  • --verbose
  • --help
  • --version

Handling special characters

Some text may get interpreted incorrectly by the bash (or zsh) interpreter, to fix this issue wrap your text in single or double quotes

Incorrect:

termuxc (

This will throw an error!

Correct:

termuxc "("

This will copy the text successfully!

Requirements:

Python 3.10+

Troubleshooting

Python Issues

Ensure your Python version is above 3.10.

Tmux support

To allow TermuxC to work inside of termux add "set -g allow-passthrough on" to your tmux configuration file.


License

This project is licensed under the MIT license, see LICENSE

Metadata

Release files for TermuxC 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TermuxC 3.1.0
File Size Uploaded
termuxc-3.1.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for TermuxC 3.1.0
File Interpreter ABI Platform
termuxc-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / termuxc-3.1.0.tar.gz

Download URL termuxc-3.1.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4b68e089bfc2bf0dff6803cbd8d98460c7baa290080e7a62bf980f94ce24e4e8
BLAKE2b-256 checksum
How to use checksums
38ee2b7a246a6cc3dccde850b000039bad1cab751c7c8e166711e0509a63f216
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / termuxc-3.1.0-py3-none-any.whl

Download URL termuxc-3.1.0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fc4f6c9c529fedfa5e85c0c240da2b616fb4935da5aca610e84c0135363513d
BLAKE2b-256 checksum
How to use checksums
0338f0a5566a1c33831beb5a99a841cb186be7a89dd9cd917323c4e2898bddfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

2.6.3

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.9

2 release files

2.5.8

2 release files

2.5.2

2 release files

2.4.5

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.2.6

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.0

2 release files

2.0.9

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page