Skip to content

Latest commit

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

NoxTerminal

A lightweight, modern terminal emulator embedded in PyQt5

PythonPyQt5PlatformLicense

Drop a fully functional terminal right into your PyQt5 app — no compromises.


Overview

NoxTerminal is a QPlainTextEdit-based terminal widget that embeds a real Windows command prompt (cmd.exe) directly into any PyQt5 application. Powered by winpty for authentic PTY interaction and pyte for proper ANSI/VT terminal emulation, it behaves like a real terminal — not a fake text box.

┌─────────────────────────────────────────────┐
│ NoxIDE Terminal _ □ ✕│
├─────────────────────────────────────────────┤
│ │
│ Microsoft Windows [Version 10.0.22631] │
│ (c) Microsoft Corporation. │
│ │
│ C:\Users\DevNexe> █ │
│ │
└─────────────────────────────────────────────┘

Features

FeatureDescription
PyQt5 NativeSubclass of QPlainTextEdit — drops into any layout
Real PTYwinpty provides authentic cmd.exe interaction
ANSI Emulationpyte handles screen state, cursor tracking, clear sequences
Non-blocking UIOutput runs in a QThread — UI stays responsive
Smart key handlingArrow keys, Tab completion, Ctrl+C/V, Delete, Home/End
Selection supportSelect text to copy; typing/backspace replaces selection
Minimalist themeDeep black (#0c0c0c) with Consolas font, zero clutter

Installation

Prerequisites

Python 3.x and the following packages:

pip install PyQt5 pywinpty pyte

Clone & Run

git clone https://github.com/devnexe-alt/NoxTerminal.git
cd NoxTerminal
python main.py

Usage

Embed NoxTerminal in your own PyQt5 application in seconds:

fromnox_terminalimportNoxTerminalfromPyQt5.QtWidgetsimportQApplicationapp=QApplication([])
terminal=NoxTerminal()
terminal.resize(900, 500)
terminal.show()
app.exec_()

No configuration required — it spawns cmd.exe automatically on init.


Customization

The terminal is intentionally minimal. Edit the stylesheet in __init__ to match your app:

self.setStyleSheet(""" QPlainTextEdit { background-color: #0c0c0c; /* terminal background */ color: #cccccc; /* text color */ border: none; padding: 5px; }""")

Change the font family or size:

font=QFont("Consolas", 10) # any monospace font worksself.setFont(font)

Architecture

NoxTerminal/
├── main.py # Entry point + NoxTerminal widget
│
├── NoxTerminal # QPlainTextEdit subclass (main widget)
│ ├── pyte.Screen # Virtual terminal screen state
│ ├── pyte.Stream # ANSI/VT sequence parser
│ └── winpty.PtyProcess# Windows PTY process (cmd.exe)
│
└── TerminalThread # QThread — reads PTY output asynchronously

Data flow:

[cmd.exe] ──PTY──▶ [TerminalThread] ──signal──▶ [NoxTerminal.on_output]
│
pyte processes ANSI
│
setPlainText(screen)
│
cursor position sync

Key Bindings

KeyAction
↑ ↓ ← →Send arrow escape sequences to PTY
TabSend tab (shell completion)
Ctrl+CSend interrupt signal
Ctrl+VPaste from clipboard into PTY
Ctrl+Shift+CCopy selection
Backspace / DeleteSend delete to PTY
Home / EndMove to line start/end

Requirements

  • OS: Windows (uses winpty and cmd.exe)
  • Python: 3.x
  • Dependencies:PyQt5, pywinpty, pyte

Made by DevNexe

About

A real PTY terminal widget for PyQt5. Embeds cmd.exe with ANSI emulation via winpty and pyte.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages