Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 1.25 KB

README.md

File metadata and controls

52 lines (34 loc) · 1.25 KB

termecho

Send commands and write data to terminals (/dev/tty and /dev/pts devices).

Examples

cd multiple terminals at once when switching to a different project:

$ sudo termecho /dev/pts/2 /dev/pts/3 -- cd ~/path/to/my/project

Write text to a vim buffer open on another terminal:

$ sudo termecho -n /dev/pts/2 -- Hello from $(tty)

Close vim on another terminal:

$ sudo termecho /dev/pts/2 -- :wq

Security

There are known security risks with the TIOCSTI ioctl syscall and caution is advised. This is intended for personal use and not for automated production use cases. Please do not run arbitrary commands through termecho without inspection (this is generally good practice anyway).

Building

termecho is written in Rust, so a Rust installation is required for compilation.

$ git clone https://github.com/SteadBytes/termecho
$ cd termecho
$ cargo build --release
$ ./target/release/termecho --version
termecho 0.1.0

Compatibility

termecho uses the TIOCSTI ioctl and as such is only available on platforms that support this syscall.