Metadata-Version: 2.4
Name: mintterm
Version: 0.2.0
Summary: A block-based terminal for Linux, built with pygame. Real bash, with safer and clearer output.
Author: Your Name
License: MIT
Project-URL: Homepage, https://github.com/YOUR-USER/mintterm
Project-URL: Issues, https://github.com/YOUR-USER/mintterm/issues
Keywords: terminal,linux,ubuntu,linux-mint,pygame,shell
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: POSIX :: Linux
Classifier: Environment :: X11 Applications
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: System :: Shells
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygame>=2.5
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Dynamic: license-file

<p align="center">
  <img src="src/mintterm/assets/logo.svg" alt="mintterm" width="420">
</p>

# mintterm

A block-based terminal for Linux, built with pygame. It runs real bash underneath, so every command you know keeps working. Each command and its output become a card, common commands show tables and bars instead of walls of text, and risky commands ask before they touch your files.

## Install

Linux Mint and Ubuntu:

```bash
pip install mintterm
mintterm
```

Windows 11, through WSL:

```powershell
wsl --install
```

Open Ubuntu from the Start menu, then run `pip install mintterm` and `mintterm`. Windows 11 shows the window through WSLg with no extra setup. Windows 10 needs an X server such as VcXsrv and is not supported in v0.2.

## Commands that look different

These run as real commands. mintterm adds flags behind the scenes so the output can be parsed, and you see the output as a table or bars.

| You type | You get |
| --- | --- |
| `ls`, `ls ~/Downloads` | Table with size, date, permissions, owner. ▸ folders, * programs, → links |
| `ls --raw` | Plain `ls` output |
| `df` | Drives with usage bars. Bars turn red above 85% |
| `du`, `du ~` | Biggest folders first, with a share bar |
| `ps` | Top 25 processes by CPU, with bars |
| `free` | RAM and swap bars |
| `ip` | Network interfaces with state and addresses |
| `ss` | Listening ports with the program that owns each one |
| `git status` | Branch, sync state, and a table of changes |
| `git log` | Last 20 commits as a table |
| `grep pattern file` | Matches as a table with file and line |
| `find ...` | Results as a table, folders highlighted |
| `apt list --upgradable` | Packages with new versions |
| `systemctl --failed` | Failed services in red |
| `cat file` | Numbered lines |

Everything else runs exactly as typed, with its output in a card. Cards work for every command: fold, pin, copy, and exit codes.

## Built-in features

- **Trash and undo.** `rm` moves files into the mintterm trash instead of deleting them. `undo` brings them back. `mv` is recorded too. `rm --really` deletes permanently.
- **Safety preview.** `rm -rf`, `sudo rm`, `dd`, `mkfs`, and `chmod -R` list what would change and wait for `y`.
- **`?` helper.** `? find big files`, `? update my system`, or `? explain tar`. It suggests commands but never runs them.
- **Tab completion.** Completes file and folder names, and lists options when several match.
- **History search.** Ctrl+R, type part of an old command, press Enter.
- **Cards.** Click a prompt line to fold a card. Ctrl+P pins a card to the top. Ctrl+Shift+C copies its output (needs `xclip` or `wl-copy`).
- **Background commands.** The window stays responsive while a command runs. Ctrl+C stops it.
- **Notifications.** If a command takes longer than 10 seconds and the window is in the background, you get a desktop notification (uses `notify-send`, included in Mint).
- **Prompt segments and profiles.** Show or hide time, user, host, folder, git branch, Python venv, and exit code. Server profile shows a red prompt so production never looks like your sandbox.

## Keys

| Key | Action |
| --- | --- |
| Enter | Run the command |
| Up / Down | Command history, or move through search results |
| Tab | Complete a file or folder name |
| Ctrl+R | Search history |
| Ctrl+P | Pin or unpin the selected card |
| Ctrl+Shift+C | Copy the selected card's output |
| Ctrl+L or `clear` | Clear the screen |
| Ctrl+U | Clear the input line |
| Ctrl+T | Switch to the next theme |
| Ctrl+C | Stop a running command, or cancel a confirmation |
| Mouse wheel | Scroll |
| Esc | Quit (or leave search) |

## Settings

Type these inside mintterm. Settings save to `~/.config/mintterm/config.json`.

```text
set theme sunset              mint-dark, mint-light, sunset
set profile Server            Dev, Server, Minimal
set font 18                   10 to 28
set segments user,host,path   time, user, host, path, git, venv, exit
set notify 10                 seconds before a desktop alert (0 = always)
set                           show current settings
```

Command-line options: `mintterm --theme mint-light` (for this run only), `mintterm --version`, `mintterm --help`.

## Limitations in v0.2

- Full-screen programs (`vim`, `nano`, `top`, `htop`) do not run inside mintterm. Use `ps` and `free` for the same information.
- `sudo` asks for a password in the terminal that launched mintterm, not in the window. Run `sudo -v` in your normal terminal first, then `sudo` commands in mintterm work for about 15 minutes.
- Output appears when a command finishes, not line by line.
- Only the commands listed above get tables. Others are shown as plain output in cards.
- Plugins, an SSH manager, widgets and session sharing are planned for later versions.

## Development

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
```

The parsers, safety checks, trash, and helper have no pygame dependency and are fully tested. The window code is tested by running it against a display.

## Publishing to PyPI

1. Create an account at pypi.org and an API token under Account settings.
2. Update `authors` and the URLs in `pyproject.toml`, and bump `version` for each release.
3. Build and check:

```bash
python -m build
twine check dist/*
```

4. Test on TestPyPI first:

```bash
twine upload --repository testpypi dist/*
pip install -i https://test.pypi.org/simple/ mintterm
```

5. Upload to the real index:

```bash
twine upload dist/*
```

Username: `__token__`. Password: your `pypi-...` token.

## License

MIT. See LICENSE.
