Skip to main content

Python Terminal Control

Project description

PyTermControl

Python only version of https://github.com/axiros/termcontrol

Starts a command within a pty from a controlling process, which reads "keystrokes" from a fifo and forwards into the child. User input may be forwarded to another fifo, instead of sending it into the child process' pty.

This way any terminal process waiting for user input can be controlled from outside.

USAGE: with_termcontrol [Params] COMMAND

  • The fifo filename (fn_fifo) is available as $STDIN_FIFO within the child. All data on this fifo will be sent into the pty.
  • If fn_fifo is set to 'auto' then we'll create a tempfile fifo
  • If you configure a forward fifo (fn_user), then all user input will be forwarded to it, instead of sending into the pty
  • The program will block(!) until a reader is attached to that user fifo
  • fn_user simply set to true will result in its filename set to $STDIN_FIFO + '.user' (and exported as $USER_INPUT_FIFO)
  • Fifos will be created only if they don't exist at process start
  • Fifos will be unlinked at exit only if they where created by us

Params: --fn_user[=False] --fn_fifo[=auto]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytermcontrol-2022.9.19.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

pytermcontrol-2022.9.19-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pytermcontrol-2022.9.19.tar.gz.

File metadata

  • Download URL: pytermcontrol-2022.9.19.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.16.15-101.fc34.x86_64

File hashes

Hashes for pytermcontrol-2022.9.19.tar.gz
Algorithm Hash digest
SHA256 9245481f78d41617f3446af5cd6431a2e83c52e188df0ab9e5e2d5ef47681927
MD5 ed4615d19e8c29d14f4231cfa872c95a
BLAKE2b-256 04160e8f90c14cb7037a441811f2423e35add0dc4ce2dbc38b9cbe996fecd4cc

See more details on using hashes here.

File details

Details for the file pytermcontrol-2022.9.19-py3-none-any.whl.

File metadata

  • Download URL: pytermcontrol-2022.9.19-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.16.15-101.fc34.x86_64

File hashes

Hashes for pytermcontrol-2022.9.19-py3-none-any.whl
Algorithm Hash digest
SHA256 e5aa94f36d7be970712acf35b835e5d00f42e5b05b5b44a03b9067e766ddca35
MD5 ec3b586416ca812a59b11e4bee3b2d28
BLAKE2b-256 072570f3a89916ee8f47b2e31147b32afa99def97232356fbb2f50c6ef6203d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page