August 30th, 2024

Show HN: A retro terminal text editor for GNU/Linux coded in C (C-edit)

C-EDIT is an alpha text editor for Linux, mimicking MSDOS EDIT, featuring a simple interface, dynamic buffer, and modular design. Installation requires source code compilation, with future enhancements planned.

Read original articleLink Icon
EnthusiasmNostalgiaAppreciation
Show HN: A retro terminal text editor for GNU/Linux coded in C (C-edit)

C-EDIT is an alpha version text editor developed in C for Linux, designed to mimic the MSDOS EDIT interface. It is currently compatible with Termux and is under active development, with the latest update in August 2024 introducing a dynamic buffer. The editor features a simple double screen buffer for improved display, a basic text user interface with windows and textboxes, automatic display resizing, and an open file dialog with scrolling. It also includes a rudimentary edit buffer with scrolling capabilities and a millisecond timer for animations. The project is modular, consisting of various source files that handle different functionalities, such as keyboard input, file management, and user interface components. Installation involves downloading the repository, navigating to the source directory, compiling the code with `make`, and executing the editor. Future plans for C-EDIT include code cleanup, adding more functionalities like home/end keys and scroll bars, and completing the menu options. Users are cautioned against using this editor for important files due to its alpha status.

- C-EDIT is a Linux text editor in alpha development, resembling MSDOS EDIT.

- It features a simple user interface, dynamic buffer, and modular design.

- Installation requires compiling from the source code.

- Future updates aim to enhance functionality and user experience.

- Users should avoid using it for important files due to its developmental stage.

AI: What people are saying
The comments on the C-EDIT article reflect a mix of nostalgia, suggestions for improvement, and appreciation for the project.
  • Many users express nostalgia for retro text editors, comparing C-EDIT to classic tools like QEdit and Borland's TUI.
  • Suggestions for enhancements include adding Unicode support, improving memory allocation, and implementing mouse support.
  • Users appreciate the simplicity and design of C-EDIT, with some sharing their own experiences in developing text editors.
  • There is interest in the potential for future developments and enhancements to the software.
  • Some comments reference related projects and tools that evoke similar retro aesthetics or functionalities.
Link Icon 17 comments
By @jll29 - about 2 months
Apart from the learning experience, there is still value in a small-sized, fast TUI text editor for Linux.

However, my two suggestions would be:

- add Unicode support (it's the 21st century, so ∑, ®, etc. should finally work); this is not easy, but the earlier you do it the less dramatic the changes will be (check out https://github.com/unicode-org/icu/tree/main/icu4c);

- don't allocate the lines individually (as you do now with malloc, having looked at the code); at least use an arena allocator, i.e. allocate larger chunks of memory and the provide your own alloc_line function that uses the larger chunks (called arenas) piecemeal. This will speed things up and reduce fragmentation. A more advanced approach would be not to use per-line buffers but to switch to rope data structures e.g. https://github.com/josephg/librope).

By @nunobrito - about 2 months
When you mentioned retro I was expecting something like editline. Now I feel old.

Anyways, the TUI on mainstream MS-DOS 6.22 and Borland from those days were incomparable to anything on mainstream Linux even on these days. For some reason Linux is the king of text mode and yet never had a proper TUI tradition.

Thank you for sharing the project. Compiled well on my side, looking forward to the next developments. My (unrequested) feedback:

+ consider renaming from C-edit (uppercase) to lower case c-edit, because it is simpler to type from the terminal.

+ the animations of the spining part on top was distracting

+ some menus missing to implement functionality, didn't test copy&paste

+ mouse support would be nice, albeit optional but would complete the MS-DOS 6.22 / borland style since it supported mouse there too

Thank you.

By @vunderba - about 2 months
Love the look, definitely throwing me back to the halcyon QBasic days.

Slightly related but another way to simulate a retro text editor (old school raster style green screen aesthetic in this instance) is to combine the "cool-retro-term" terminal with the minimal editor "micro".

https://github.com/Swordfish90/cool-retro-term

https://github.com/zyedidia/micro

By @teddyh - about 2 months
The Craft of Text Editing¹ should be required reading for everybody who wants to write a new text editor.

1. <https://www.finseth.com/craft/>

By @Brian_K_White - about 2 months
Going sort of the other way, making an X version of a Borland-like ui, a long time ago I liked XWPE for a while. Even built it for SCO.
By @afc - about 2 months
Very cool!

I've also been writing my own terminal text editor for a while (just crossed the ten years mark!), so I know how much dedication this takes. :-)

One thing I did recently was start writing the lessons I've learned in my journey, I figured I'd share it in case it helps you, maybe you'll find one or two ideas interesting: https://github.com/alefore/weblog/blob/master/edge-lessons.m...

By @baudaux - about 2 months
I have added cedit in exaequOS: https://exaequos.com/?a=/usr/bin/cedit ! It compiled successfully with no change. Still buggy, I need to investigate and fix
By @garganzol - about 2 months
Despite being developed in 2010s-2020s, the codebase gives those warm 1980s vibes. Microcomputers, endless possibilities, bright future ahead. What a departure from the modern world of doom.
By @westurner - about 2 months
QB64 is an EDIT.COM-style IDE and a compiler for QuickBasic .BAS programs: https://github.com/QB64Official/qb64#usage

There's a QBjs, for QuickBasic on the web.

There's a QB64 vscode extension: https://github.com/QB64Official/vscode

Textual has a MarkdownViewer TUI control with syntax highlighting and a file tree in a side panel like NERDtree, but not yet a markdown editor.

By @makz - about 1 month
This is awesome, for the past few months I’ve wondered why there was nothing like edit for Linux and now we have it, great.
By @baudaux - about 2 months
I will try to compile it for https://exaequos.com !
By @qskousen - about 2 months
Looks great! Makes me nostalgic for when I spent my days as a kid in QEdit.

https://winworldpc.com/product/qedit/30

By @two_handfuls - about 2 months
This look brings back old memories! Great job!
By @Turboblack - about 2 months
It would be nice to have one like this (full screen) for Windows
By @syngrog66 - about 2 months
vim
By @miohtama - about 2 months
FYI The classical Borland text user inteface (TUI) framework used in Turbo Pascal and other terminal MS-DOS editors is open source.

Turbo Vision: https://github.com/magiblot/tvision