Metadata-Version: 2.4
Name: TmuxTerminalManager
Version: 1.2
Summary: A local web UI for starting, stopping, monitoring, and arranging tmux-managed command cards.
Author-email: Nishanth Rajkumar <nishanthrajkumar1@gmail.com>
Keywords: tmux,dashboard,terminal,process-manager
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Tmux Manager v1.2

Tmux Manager is a configurable local web UI for starting, stopping, monitoring, and arranging tmux-managed command cards.

## Features

- Four card slots per row on wide screens
- Edit Mode for layout changes
- Drag cards into empty slots
- Drop a card onto another card; the card that was there moves to the next available slot
- Card positions are saved in `commands.json` using a `slot` field
- Add/edit/delete cards from the UI
- Each card runs in its own tmux window
- Logs are cached under `logs/`

## Install

```bash
sudo apt update
sudo apt install -y tmux python3
```

Install from PyPI:

```bash
python3 -m pip install TmuxTerminalManager
```

For local development from a clone:

```bash
python3 -m pip install -e .
```

## Start

```bash
TmuxManager
```

Open:

```text
http://127.0.0.1:8765
```

## Edit Mode layout

1. Click **Edit Mode: Off** to turn it on.
2. Empty slots will appear.
3. Click and drag a card.
4. Drop it into an empty slot, or drop it onto another card.
5. Layout saves automatically to `~/.tmux_manager/commands.json`.

Runtime files are stored under `~/.tmux_manager` by default:

- `commands.json` for saved cards
- `logs/` for cached output
- `state/` for tmux-managed process state

Set `TMUX_MANAGER_HOME=/path/to/folder` before launch to use a different data directory.

## Example command entries

### Isaac Sim alias/function

```bash
bash -ic 'isaacsim_ros'
```

### ROS 2 launch

```bash
source /opt/ros/humble/setup.bash && source ~/your_ws/install/setup.bash && exec ros2 launch my_pkg my_launch.launch.py
```

### Shell script

```bash
bash ./ffmpeg.sh
```

### Docker foreground

```bash
docker run --rm -it --name mediamtx your_image
```

## Stop behavior

The UI's **Ctrl+C Stop** button sends the same thing as pressing Ctrl+C inside the tmux window:

```bash
tmux send-keys -t tmux_manager:<card_id> C-c
```

Foreground commands should stop cleanly.

Background commands using `&`, `nohup`, or `docker run -d` may continue after the shell exits.
