You are browsing as a guest. Sign up (or log in) to start making projects!

Os in a py terminal

  • 1 Devlogs
  • 1 Total hours

A simple os in a terminal made with py

Ship #1

TerminalOS
A simulated CLI operating system in Python with a boot animation, dynamic account creation, a file manager (vi-like shortcuts), and a custom shell.

Core Achievements
Clean Arhitecture: Uses a structured Python class and a dictionary dispatch pattern instead of messy if/elif chains.

Crash Prevention: Built-in data recovery that automatically resets the JSON state if it gets corrupted during forced exits.

Polished Details: Raw ANSI text rendering for graphics/Matrix rain and hardcoded patches for input edge-cases.

Zero Dependencies: Runs entirely on Python's standard library.

Tester Guide
Dynamic Login: Type ANY username and password.

  • 1 devlog
  • 1h
Try project → See source code →
Open comments for this post

1h 16m logged

Developer Log - TerminalOS

Project Overview

TerminalOS is an interactive CLI simulation designed to mimic a basic Unix-like environment inside a standard console. The development focused heavily on shifting from unstructured procedural code to a robust object-oriented architecture, improving data persistence stability, and refining user interaction.

What Was Achieved

OOP Architecture Conversion

The entire codebase was refactored into a centralized TerminalOS class. Instead of passing state manually through disparate functions or relying on unsafe global variables, the application now encapsulates its configuration, user profiles, and runtime loops inside dedicated class properties (self.state, self.user, self.running).

Scalable Menu Navigation (Dictionary Dispatch)

To avoid messy, nested if/elif/else blocks inside the main user loop, a dictionary dispatch pattern was implemented in the desktop interface. By mapping user selection keys directly to object methods, the code remains clean, readable, and easy to extend with new features in the future.

Defensive Error Handling and State Recovery

Recognizing that sudden terminal closures frequently cause JSON files to corrupt, the state loading mechanism was hardened. The system explicitly traps json.JSONDecodeError and ValueError during startup. If a bad file is detected, it logs a warning cleanly to sys.stderr and drops back to a safe default payload, preventing hard system crashes.

Input Sanitization and Quality-of-Life Patches

Local validation testing revealed edge-case bugs, such as accidental whitespace entry skipping password validation. This was patched by applying .strip() to user string inputs and adding fallbacks for empty names. Additionally, the Matrix rain visual effect was updated with a customized mixed-ASCII charset to move away from overused open-source tropes.

Technical Debt & Next Steps

  • The hardware diagnostics panel currently uses static, hardcoded placeholder data. This needs to be converted to dynamic readouts using standard library utilities to keep the project dependency-free.
0
Original post
@Nanos

Developer Log - TerminalOS

Project Overview

TerminalOS is an interactive CLI simulation designed to mimic a basic Unix-like environment inside a standard console. The development focused heavily on shifting from unstructured procedural code to a robust object-oriented architecture, improving data persistence stability, and refining user interaction.

What Was Achieved

OOP Architecture Conversion

The entire codebase was refactored into a centralized TerminalOS class. Instead of passing state manually through disparate functions or relying on unsafe global variables, the application now encapsulates its configuration, user profiles, and runtime loops inside dedicated class properties (self.state, self.user, self.running).

Scalable Menu Navigation (Dictionary Dispatch)

To avoid messy, nested if/elif/else blocks inside the main user loop, a dictionary dispatch pattern was implemented in the desktop interface. By mapping user selection keys directly to object methods, the code remains clean, readable, and easy to extend with new features in the future.

Defensive Error Handling and State Recovery

Recognizing that sudden terminal closures frequently cause JSON files to corrupt, the state loading mechanism was hardened. The system explicitly traps json.JSONDecodeError and ValueError during startup. If a bad file is detected, it logs a warning cleanly to sys.stderr and drops back to a safe default payload, preventing hard system crashes.

Input Sanitization and Quality-of-Life Patches

Local validation testing revealed edge-case bugs, such as accidental whitespace entry skipping password validation. This was patched by applying .strip() to user string inputs and adding fallbacks for empty names. Additionally, the Matrix rain visual effect was updated with a customized mixed-ASCII charset to move away from overused open-source tropes.

Technical Debt & Next Steps

  • The hardware diagnostics panel currently uses static, hardcoded placeholder data. This needs to be converted to dynamic readouts using standard library utilities to keep the project dependency-free.

Replies

Loading replies…

0
2

Followers

Loading…