https://github.com/dukerupert/terminfo-copy
A simple Go utility that streamlines copying Terminfo configurations to remote servers, making it easier to maintain consistent terminal behavior across different machines. Inspired by Ghostty's Terminfo installation process.
https://github.com/dukerupert/terminfo-copy
Last synced: 11 months ago
JSON representation
A simple Go utility that streamlines copying Terminfo configurations to remote servers, making it easier to maintain consistent terminal behavior across different machines. Inspired by Ghostty's Terminfo installation process.
- Host: GitHub
- URL: https://github.com/dukerupert/terminfo-copy
- Owner: DukeRupert
- License: mit
- Created: 2025-02-07T14:37:13.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-07T14:44:45.000Z (over 1 year ago)
- Last Synced: 2025-03-11T21:53:34.976Z (over 1 year ago)
- Language: Go
- Size: 1.46 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terminfo Copy Utility
A simple command-line utility to copy Terminfo configurations to remote servers. This tool streamlines the process of setting up terminal configurations across multiple machines, particularly useful for users of modern terminal emulators.
## Purpose
When working with modern terminal emulators, having the correct Terminfo configuration on remote servers is crucial for proper terminal behavior. This utility automates the process of copying your local Terminfo configuration to remote servers, helping prevent common issues with terminal compatibility.
## Installation
To install the utility, ensure you have Go installed on your system, then run:
```bash
go install github.com/dukerupert/terminfo-copy@latest
```
Or clone the repository and use the provided Makefile:
```bash
git clone https://github.com/dukerupert/terminfo-copy.git
cd terminfo-copy
# Run directly
make run
# Or install globally
make install
```
### Setting Up Your PATH
After installation, you'll need to ensure the Go binary directory is in your system PATH to run `terminfo-copy` from any location. Here's how to set it up:
For Bash users (Linux/macOS):
```bash
# Add this line to ~/.bashrc
export PATH=$PATH:$(go env GOPATH)/bin
# Then apply the changes
source ~/.bashrc
```
For Zsh users:
```bash
# Add this line to ~/.zshrc
export PATH=$PATH:$(go env GOPATH)/bin
# Then apply the changes
source ~/.zshrc
```
For Fish shell users:
```bash
# This command will add the path permanently
set -U fish_user_paths (go env GOPATH)/bin $fish_user_paths
```
You can verify the installation by running:
```bash
which terminfo-copy
```
## Usage
After proper installation and PATH configuration, run the utility from any directory by typing:
```bash
terminfo-copy
```
The tool will:
1. Prompt you for the remote server address (e.g., user@hostname)
2. Extract your local Terminfo configuration
3. Copy and install it on the remote server
## Requirements
- Go 1.19 or later
- SSH access to the remote server
- `infocmp` command available locally
- Write permissions in the Terminfo directory on the remote server
## How It Works
The utility executes the following command sequence:
```bash
infocmp -x | ssh YOUR-SERVER -- tic -x -
```
This extracts your local terminal information using `infocmp` and pipes it through SSH to the remote server, where `tic` installs it in the appropriate location.
## Acknowledgments
This utility was inspired by the Terminfo installation documentation from the [Ghostty terminal emulator](https://ghostty.org/docs/help/terminfo). The approach of using `infocmp` and `tic` for Terminfo transfer was adapted from their documentation.
## License
MIT License - See LICENSE file for details