Skip to main content

Terminal emulator built on Tkinter library.

Project description

PyPI PyPI - Python Version Platform

TkTerm - Tkinter Terminal Emulator

A fully functional terminal emulator built on Tkinter library - perform all basic commands of a terminal

Under the hood it executes commands using Python's subprocess module and spawn as a thread. Pressing Ctrl-C will terminate current running command. Supports Unix shells (sh and bash) and Window's Command Prompt (cmd.exe) commands.

Features

  • Compatible with Windows and Unix systems
  • Tabbed Terminal - click & drag to reorder, middle-click to close tab, double-click to rename
  • Return Code (RC) of previous run commands is shown at the bottom status bar
  • Settings to customise colours, font and cursor shape
  • Ctrl-C to kill current running process
  • Ctrl-F to search; supports case sensitivity and regex searches
  • UP and DOWN arrow keys to cycle between next and previous commands in history
  • Unix-like tab completion on files and directories
  • Handles multiline commands using caret character ^ or \

Requirements

The Tkinter GUI library is built into Python, so no 3rd party library is required.

Requires at least Python version 3.x and above.

Installation

Get it from Github or PIP package manager

# From github
git clone https://github.com/dhanoosu/TkTerm.git

# From package manager
pip install tkterm

Standalone usage

Navigate to downloaded folder and run script with

cd TkTerm

# Either of these will work
python tkterm
python tkterm/tkterm.py

If package was installed via pip

python -m tkterm

Integration with other Tkinter application

The Terminal is implemented as a Frame widget and can easily be integrated to other Tkinter application by

import tkinter as tk
from tkinter import *
from tkterm import Terminal

root = tk.Tk()

terminal = Terminal(root)
terminal.pack(fill=BOTH, expand=True)

root.mainloop()

If downloaded via github append to system path before import

import sys
sys.path.insert(0, "./TkTerm")
from tkterm import Terminal

Customisation options

Customise Terminal interface by Right-click > Settings...

Note:
Clicking Save config saves setting configuration to a file.
Tkterm will automatically load this file the next time it starts up.

Multiline command

Long lines of command can be broken up using a caret. A caret at the line end appends the next line command with the current command. In Windows the caret is ^, and UNIX is \.

For multiline command to be considered there must be no trailing space after the caret, for example:

  • $> ping ^ is considered
  • $> ping ^ is not considered
$>> echo I ^
> have apple ^
> and banana
I have apple and banana

Author

Developed by Dhanoo Surasarang

Github: @dhanoosu

Links

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

tkterm-0.0.0b2.tar.gz (139.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkterm-0.0.0b2-py3-none-any.whl (146.6 kB view details)

Uploaded Python 3

File details

Details for the file tkterm-0.0.0b2.tar.gz.

File metadata

  • Download URL: tkterm-0.0.0b2.tar.gz
  • Upload date:
  • Size: 139.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for tkterm-0.0.0b2.tar.gz
Algorithm Hash digest
SHA256 52369039dfd5cbd1b0044a8593be19028f9123ea003bbd5d69aa1fb38e4e37fe
MD5 88313f8fedd720ce1d998d41f23b67fa
BLAKE2b-256 1541fe3224472f9bff1fb1d360e9ff656792b7e508d1850ff4b6321f8c78da47

See more details on using hashes here.

File details

Details for the file tkterm-0.0.0b2-py3-none-any.whl.

File metadata

  • Download URL: tkterm-0.0.0b2-py3-none-any.whl
  • Upload date:
  • Size: 146.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for tkterm-0.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ceafad182b49de408303e8b594b4ac867627eb4944f3494dff8c60a59a1ff4e
MD5 4c388039084c3f1da01598b0931dfc3a
BLAKE2b-256 03436cf82c3830a94e9a66e141ef0a7658f3f95af10d1f481b5323cd567b9213

See more details on using hashes here.

Supported by

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