tmcode 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tmcode-0.2.0/LICENSE +21 -0
- tmcode-0.2.0/PKG-INFO +128 -0
- tmcode-0.2.0/README.md +101 -0
- tmcode-0.2.0/pyproject.toml +53 -0
- tmcode-0.2.0/setup.cfg +4 -0
- tmcode-0.2.0/src/termcode/__init__.py +3 -0
- tmcode-0.2.0/src/termcode/app.py +2236 -0
- tmcode-0.2.0/src/termcode/buffers.py +168 -0
- tmcode-0.2.0/src/termcode/cli.py +69 -0
- tmcode-0.2.0/src/termcode/commands.py +234 -0
- tmcode-0.2.0/src/termcode/completions.py +205 -0
- tmcode-0.2.0/src/termcode/findbar.py +258 -0
- tmcode-0.2.0/src/termcode/formatting.py +365 -0
- tmcode-0.2.0/src/termcode/highlighting.py +61 -0
- tmcode-0.2.0/src/termcode/modals.py +431 -0
- tmcode-0.2.0/src/termcode/runner.py +725 -0
- tmcode-0.2.0/src/termcode/search.py +105 -0
- tmcode-0.2.0/src/termcode/styles.tcss +796 -0
- tmcode-0.2.0/src/termcode/theme.py +99 -0
- tmcode-0.2.0/src/termcode/workspace.py +271 -0
- tmcode-0.2.0/src/tmcode.egg-info/PKG-INFO +128 -0
- tmcode-0.2.0/src/tmcode.egg-info/SOURCES.txt +34 -0
- tmcode-0.2.0/src/tmcode.egg-info/dependency_links.txt +1 -0
- tmcode-0.2.0/src/tmcode.egg-info/entry_points.txt +3 -0
- tmcode-0.2.0/src/tmcode.egg-info/requires.txt +7 -0
- tmcode-0.2.0/src/tmcode.egg-info/top_level.txt +1 -0
- tmcode-0.2.0/tests/test_app.py +835 -0
- tmcode-0.2.0/tests/test_buffers.py +66 -0
- tmcode-0.2.0/tests/test_commands.py +53 -0
- tmcode-0.2.0/tests/test_completions.py +56 -0
- tmcode-0.2.0/tests/test_foreground.py +51 -0
- tmcode-0.2.0/tests/test_formatting.py +168 -0
- tmcode-0.2.0/tests/test_highlighting.py +19 -0
- tmcode-0.2.0/tests/test_runner.py +283 -0
- tmcode-0.2.0/tests/test_search.py +68 -0
- tmcode-0.2.0/tests/test_workspace.py +121 -0
tmcode-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Abdullah Al Mamun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tmcode-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tmcode
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: TmCode: a lightweight terminal code editor with run, find/replace, format-on-save and a real-terminal mode
|
|
5
|
+
Author: Abdullah Al Mamun
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/abdullahalmamun29/tmcode
|
|
8
|
+
Project-URL: Issues, https://github.com/abdullahalmamun29/tmcode/issues
|
|
9
|
+
Keywords: editor,terminal,tui,ide,textual
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Education
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Text Editors
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: textual[syntax]>=0.80.0
|
|
21
|
+
Requires-Dist: tree-sitter-c>=0.23.0
|
|
22
|
+
Requires-Dist: tree-sitter-cpp>=0.23.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# TermCode
|
|
29
|
+
|
|
30
|
+
Lightweight, cross-platform VS Code-style terminal code editor and runner for **Python**, **C**, and **C++**.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- Launch right from any terminal (`termcode` from `~` opens the Home folder picker; `termcode` inside any project folder opens it directly)
|
|
35
|
+
- VS Code Dark Modern 3-pane layout: Explorer with `+F`/`+D` buttons, multi-tab + side-by-side split editor (`F12`), and draggable/resizable Terminal panel
|
|
36
|
+
- VS Code Dark+ syntax colors across **17 languages** (Python, C, C++, JS/TS, HTML, CSS, JSON, Java, Go, Rust, Bash, SQL, Markdown, YAML, TOML, XML, Regex)
|
|
37
|
+
- Lightweight offline code suggestions (language builtins + open-file words) and automatic indentation while typing
|
|
38
|
+
- Unified `/run` (`F5`) supporting **Python, C, C++, JavaScript, TypeScript, Bash, Go, Rust, Java, Ruby, PHP, Perl, and Lua** with live interactive keyboard input
|
|
39
|
+
- Real OS clipboard integration (Linux X11/Wayland, macOS, Windows), `Ctrl+A` select-all, and VS Code-style `Ctrl+C` (copies selection or current line)
|
|
40
|
+
- Searchable `/` command menu (`Ctrl+K` anywhere, or `/` outside text inputs) with a shortcut for every action
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
TmCode needs **Python 3.10+**. The easiest way is [pipx](https://pipx.pypa.io), which installs it in its own isolated environment and puts the `tmcode` command on your PATH.
|
|
45
|
+
|
|
46
|
+
### Linux / macOS
|
|
47
|
+
```bash
|
|
48
|
+
python3 -m pip install --user pipx # or: sudo apt install pipx / brew install pipx
|
|
49
|
+
python3 -m pipx ensurepath # then open a new terminal
|
|
50
|
+
pipx install tmcode
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Windows (PowerShell)
|
|
54
|
+
```powershell
|
|
55
|
+
py -m pip install --user pipx
|
|
56
|
+
py -m pipx ensurepath # then open a new terminal
|
|
57
|
+
pipx install tmcode
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then run `tmcode` (the old `termcode` command works too).
|
|
61
|
+
|
|
62
|
+
**Update:** `pipx upgrade tmcode` · **Uninstall:** `pipx uninstall tmcode`
|
|
63
|
+
|
|
64
|
+
Install the latest code straight from GitHub instead of PyPI:
|
|
65
|
+
```bash
|
|
66
|
+
pipx install git+https://github.com/abdullahalmamun29/tmcode.git
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Optional extras
|
|
70
|
+
- To **run** code you need the language itself installed: `python3`, `gcc`/`g++` for C/C++, `node`, `go`, `rustc`, `java`, etc.
|
|
71
|
+
- **Format on save** works out of the box with a built-in re-indenter. If `ruff`/`black`, `clang-format`, `prettier`, `gofmt` or `rustfmt` are installed, TmCode uses them automatically.
|
|
72
|
+
- The resize pointer (↔ ↕ on panel edges) shows in kitty, WezTerm, Ghostty, foot and xterm; other terminals show the highlighted grip instead.
|
|
73
|
+
|
|
74
|
+
### From source (for development)
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/abdullahalmamun29/tmcode.git
|
|
77
|
+
cd tmcode
|
|
78
|
+
python3 -m venv .venv
|
|
79
|
+
.venv/bin/pip install -e ".[dev]"
|
|
80
|
+
.venv/bin/pytest
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Usage
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
termcode # From ~ opens the Home tab (folder selector & recent folders); from any project folder opens it directly
|
|
87
|
+
termcode . # Open current directory directly (from ~ this still shows the start page)
|
|
88
|
+
termcode path/to/project # Open a specific folder
|
|
89
|
+
termcode path/to/main.py # Open a specific file and its folder
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## `/` Command Menu & Shortcuts
|
|
93
|
+
|
|
94
|
+
Open the menu anytime with **`Ctrl+K`**, or press **`/`** when focus is on the file tree or terminal log.
|
|
95
|
+
|
|
96
|
+
| Command | Shortcut | Action |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `/run` | `F5` | Save and run active file in Terminal panel |
|
|
99
|
+
| `/stop` | `F7` | Stop currently running program |
|
|
100
|
+
| `/save` | `Ctrl+S` | Save active file |
|
|
101
|
+
| `/save-as` | `F8` | Save current buffer under a new name |
|
|
102
|
+
| `/new-file` | `Ctrl+N` | Create a new file in the selected folder |
|
|
103
|
+
| `/new-folder` | `F3` | Create a new folder in the selected folder |
|
|
104
|
+
| `/open-file` | `Ctrl+P` | Quick-select and open a file in this folder |
|
|
105
|
+
| `/open-folder` | `Ctrl+O` | Browse & open another folder as workspace root |
|
|
106
|
+
| `/rename` | `F2` | Rename selected file or folder |
|
|
107
|
+
| `/delete` | `F4` | Delete selected file or folder (with confirmation) |
|
|
108
|
+
| `/toggle-sidebar` | `Ctrl+B` | Show or hide the Explorer sidebar |
|
|
109
|
+
| `/toggle-terminal` | `Ctrl+J` | Show or hide the bottom Terminal panel |
|
|
110
|
+
| `/toggle-hidden` | `F9` | Show or hide hidden dotfiles in Explorer |
|
|
111
|
+
| `/terminal-grow` | `Ctrl+Up` | Increase Terminal panel height (or drag header bar) |
|
|
112
|
+
| `/terminal-shrink` | `Ctrl+Down` | Decrease Terminal panel height (or drag header bar) |
|
|
113
|
+
| `/copy-output` | `F10` | Copy selected or full Terminal output |
|
|
114
|
+
| `/clear-output` | `Ctrl+L` | Clear the Terminal output |
|
|
115
|
+
| `/next-tab` | `F11` | Switch to the next open file tab |
|
|
116
|
+
| `/close-tab` | `Ctrl+W` | Close the current file tab |
|
|
117
|
+
| `/split-editor` | `F12` | Toggle side-by-side split editor |
|
|
118
|
+
| `/quit` | `Ctrl+Q` | Exit TermCode |
|
|
119
|
+
|
|
120
|
+
## Running Tests
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
.venv/bin/pytest -v
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT © 2026 Abdullah Al Mamun. See [LICENSE](LICENSE).
|
tmcode-0.2.0/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# TermCode
|
|
2
|
+
|
|
3
|
+
Lightweight, cross-platform VS Code-style terminal code editor and runner for **Python**, **C**, and **C++**.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Launch right from any terminal (`termcode` from `~` opens the Home folder picker; `termcode` inside any project folder opens it directly)
|
|
8
|
+
- VS Code Dark Modern 3-pane layout: Explorer with `+F`/`+D` buttons, multi-tab + side-by-side split editor (`F12`), and draggable/resizable Terminal panel
|
|
9
|
+
- VS Code Dark+ syntax colors across **17 languages** (Python, C, C++, JS/TS, HTML, CSS, JSON, Java, Go, Rust, Bash, SQL, Markdown, YAML, TOML, XML, Regex)
|
|
10
|
+
- Lightweight offline code suggestions (language builtins + open-file words) and automatic indentation while typing
|
|
11
|
+
- Unified `/run` (`F5`) supporting **Python, C, C++, JavaScript, TypeScript, Bash, Go, Rust, Java, Ruby, PHP, Perl, and Lua** with live interactive keyboard input
|
|
12
|
+
- Real OS clipboard integration (Linux X11/Wayland, macOS, Windows), `Ctrl+A` select-all, and VS Code-style `Ctrl+C` (copies selection or current line)
|
|
13
|
+
- Searchable `/` command menu (`Ctrl+K` anywhere, or `/` outside text inputs) with a shortcut for every action
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
TmCode needs **Python 3.10+**. The easiest way is [pipx](https://pipx.pypa.io), which installs it in its own isolated environment and puts the `tmcode` command on your PATH.
|
|
18
|
+
|
|
19
|
+
### Linux / macOS
|
|
20
|
+
```bash
|
|
21
|
+
python3 -m pip install --user pipx # or: sudo apt install pipx / brew install pipx
|
|
22
|
+
python3 -m pipx ensurepath # then open a new terminal
|
|
23
|
+
pipx install tmcode
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Windows (PowerShell)
|
|
27
|
+
```powershell
|
|
28
|
+
py -m pip install --user pipx
|
|
29
|
+
py -m pipx ensurepath # then open a new terminal
|
|
30
|
+
pipx install tmcode
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Then run `tmcode` (the old `termcode` command works too).
|
|
34
|
+
|
|
35
|
+
**Update:** `pipx upgrade tmcode` · **Uninstall:** `pipx uninstall tmcode`
|
|
36
|
+
|
|
37
|
+
Install the latest code straight from GitHub instead of PyPI:
|
|
38
|
+
```bash
|
|
39
|
+
pipx install git+https://github.com/abdullahalmamun29/tmcode.git
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Optional extras
|
|
43
|
+
- To **run** code you need the language itself installed: `python3`, `gcc`/`g++` for C/C++, `node`, `go`, `rustc`, `java`, etc.
|
|
44
|
+
- **Format on save** works out of the box with a built-in re-indenter. If `ruff`/`black`, `clang-format`, `prettier`, `gofmt` or `rustfmt` are installed, TmCode uses them automatically.
|
|
45
|
+
- The resize pointer (↔ ↕ on panel edges) shows in kitty, WezTerm, Ghostty, foot and xterm; other terminals show the highlighted grip instead.
|
|
46
|
+
|
|
47
|
+
### From source (for development)
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/abdullahalmamun29/tmcode.git
|
|
50
|
+
cd tmcode
|
|
51
|
+
python3 -m venv .venv
|
|
52
|
+
.venv/bin/pip install -e ".[dev]"
|
|
53
|
+
.venv/bin/pytest
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
termcode # From ~ opens the Home tab (folder selector & recent folders); from any project folder opens it directly
|
|
60
|
+
termcode . # Open current directory directly (from ~ this still shows the start page)
|
|
61
|
+
termcode path/to/project # Open a specific folder
|
|
62
|
+
termcode path/to/main.py # Open a specific file and its folder
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## `/` Command Menu & Shortcuts
|
|
66
|
+
|
|
67
|
+
Open the menu anytime with **`Ctrl+K`**, or press **`/`** when focus is on the file tree or terminal log.
|
|
68
|
+
|
|
69
|
+
| Command | Shortcut | Action |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| `/run` | `F5` | Save and run active file in Terminal panel |
|
|
72
|
+
| `/stop` | `F7` | Stop currently running program |
|
|
73
|
+
| `/save` | `Ctrl+S` | Save active file |
|
|
74
|
+
| `/save-as` | `F8` | Save current buffer under a new name |
|
|
75
|
+
| `/new-file` | `Ctrl+N` | Create a new file in the selected folder |
|
|
76
|
+
| `/new-folder` | `F3` | Create a new folder in the selected folder |
|
|
77
|
+
| `/open-file` | `Ctrl+P` | Quick-select and open a file in this folder |
|
|
78
|
+
| `/open-folder` | `Ctrl+O` | Browse & open another folder as workspace root |
|
|
79
|
+
| `/rename` | `F2` | Rename selected file or folder |
|
|
80
|
+
| `/delete` | `F4` | Delete selected file or folder (with confirmation) |
|
|
81
|
+
| `/toggle-sidebar` | `Ctrl+B` | Show or hide the Explorer sidebar |
|
|
82
|
+
| `/toggle-terminal` | `Ctrl+J` | Show or hide the bottom Terminal panel |
|
|
83
|
+
| `/toggle-hidden` | `F9` | Show or hide hidden dotfiles in Explorer |
|
|
84
|
+
| `/terminal-grow` | `Ctrl+Up` | Increase Terminal panel height (or drag header bar) |
|
|
85
|
+
| `/terminal-shrink` | `Ctrl+Down` | Decrease Terminal panel height (or drag header bar) |
|
|
86
|
+
| `/copy-output` | `F10` | Copy selected or full Terminal output |
|
|
87
|
+
| `/clear-output` | `Ctrl+L` | Clear the Terminal output |
|
|
88
|
+
| `/next-tab` | `F11` | Switch to the next open file tab |
|
|
89
|
+
| `/close-tab` | `Ctrl+W` | Close the current file tab |
|
|
90
|
+
| `/split-editor` | `F12` | Toggle side-by-side split editor |
|
|
91
|
+
| `/quit` | `Ctrl+Q` | Exit TermCode |
|
|
92
|
+
|
|
93
|
+
## Running Tests
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
.venv/bin/pytest -v
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
MIT © 2026 Abdullah Al Mamun. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "tmcode"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "TmCode: a lightweight terminal code editor with run, find/replace, format-on-save and a real-terminal mode"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Abdullah Al Mamun" }]
|
|
14
|
+
keywords = ["editor", "terminal", "tui", "ide", "textual"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: Education",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Topic :: Text Editors",
|
|
23
|
+
]
|
|
24
|
+
dependencies = [
|
|
25
|
+
"textual[syntax]>=0.80.0",
|
|
26
|
+
"tree-sitter-c>=0.23.0",
|
|
27
|
+
"tree-sitter-cpp>=0.23.0",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://github.com/abdullahalmamun29/tmcode"
|
|
32
|
+
Issues = "https://github.com/abdullahalmamun29/tmcode/issues"
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
dev = [
|
|
36
|
+
"pytest>=8.0.0",
|
|
37
|
+
"pytest-asyncio>=0.23.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
tmcode = "termcode.cli:main"
|
|
42
|
+
termcode = "termcode.cli:main"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.package-data]
|
|
48
|
+
termcode = ["*.tcss"]
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
testpaths = ["tests"]
|
|
52
|
+
asyncio_mode = "auto"
|
|
53
|
+
asyncio_default_fixture_loop_scope = "function"
|
tmcode-0.2.0/setup.cfg
ADDED