28

I dunno if this is appropriate for this community, so mods, please delete if not.

I have been writing a screen clone in rust.

https://github.com/cameroncros/PoorMansScreen/tree/better_screen (The main branch is how I currently use it, not at all screen-like, the better_screen branch is much closer to a screen replacement.)

It all currently works fine, albeit quite simple, and I suspect not following best practices. Please talk shit about my code so I can fix that :D

For my next stage of development, I would like to use some combo of vt100 and ratatui to wrap the shell in a border, or add a menu bar at the top or bottom to make it clear when the user is inside a "screen". Does anyone have any thoughts on how to go about doing that? I am very unskilled at ratatui.

you are viewing a single comment's thread
view the rest of the comments
[-] BB_C@programming.dev 8 points 2 months ago

If you're serious about creating something good/better, you should use alacritty_terminal (not to be confused with the terminal app built on top of it) for low-level (from your PoV) terminal support.

This is something zellij didn't do. And now they have "basic functionality" bugs like this one open for years.

I also wonder what made you pick screen as a baseline to improve on instead of tmux.

[-] CameronDev@programming.dev 6 points 2 months ago

I'll look into that, I'm currently just using cross term, which was enough to pass my rudimentary tests of nyancat. I'll have to create some form of test suite to chuck various inputs at it and confirm it all works correctly.

Its definitely not intended to replace screen or be better, that would require a lot more features and work that I just dont want to do. Its for fun/scratching an itch.

I started it originally when I had issues with screen and permissions issues. The main branch is what I actually use, and I use it for running Minecraft servers. Its just an easy way to send commands to stdin of the process. (Stdout connected to regular stdout, stdin connected directly to a Unix socket).

As for tmux, most I'm not that familiar with it, and used screen more.

[-] CameronDev@programming.dev 2 points 2 months ago

Well, your point stands regarding alacritty_terminal, but right now, it actually works just fine for that test case:

I suspect once I stop directing the raw input/output to the shell, it might become more important.

[-] XTL@sopuli.xyz 1 points 2 months ago* (last edited 2 months ago)

My first thoughts was also "Don't. Clone tmux instead." But don't use ctrl-b. It's a massively awkward and annoying combo on common keyboards. And don't make it necessary to release ctrl before the second key.

[-] BB_C@programming.dev 3 points 2 months ago

But don’t use ctrl-b

What migrant from screen didn't start by adding this to tmux config? 😄

set-option -g prefix C-a
unbind-key "C-b"
bind-key "C-a" send-prefix
[-] sugar_in_your_tea@sh.itjust.works 1 points 2 months ago

I do the same, but with ctrl-t. Ctrl-a means select all, and t means "tmux" and happens to be under my right middle finger on my layout (dvorak).

this post was submitted on 17 Feb 2025
28 points (93.8% liked)

Rust

6865 readers
7 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS