https://github.com/grimdork/tcon
A simple wrapper for tcell-based text-only interfaces.
https://github.com/grimdork/tcon
handler tcell terminal-based wrapper
Last synced: about 1 year ago
JSON representation
A simple wrapper for tcell-based text-only interfaces.
- Host: GitHub
- URL: https://github.com/grimdork/tcon
- Owner: grimdork
- License: mit
- Created: 2021-02-06T08:56:48.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-02-25T07:40:33.000Z (over 3 years ago)
- Last Synced: 2025-01-30T05:43:37.042Z (over 1 year ago)
- Topics: handler, tcell, terminal-based, wrapper
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tcon
A simple wrapper for tcell-based text-only interfaces.
## Requirements
- `go get github.com/gdamore/tcell`
## What and why?
I wanted a terminal-based environment with a fixed-position command line and a large text area to display text. Other packages were mimicking GUIs in text mode, but that's more than I needed for some of my projects.
## Features
- Command box with editable input and history.
- Text output with word wrap and less-mode.
- Title and status lines.
- Callbacks for input and command handling.
## Keyboard shortcuts
There is a separate handler for different types of input. These are:
- OnCommandFunc: This callback receives a string with the command buffer. The rest is up to the user.
- OnRuneFunc: Filter callback to allow special handling while typing. Optionally return 0 to skip symbols.
- OnFunc: The generic callback, used with SetTabFunc() and SetEscFunc().
- OnCtrlFunc: Handler for control keys.
NOTE: Remember to set up a key or command to call the Quit() method.
## TODO
(Possible) future enhancements:
- Coloured status and mode
- Command line manipulation in the filter?
- Built-in TAB-completion?
- Figure out why resizing sometimes messes up things