this post was submitted on 17 Feb 2025
27 points (96.6% liked)

Rust

6402 readers
70 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
 

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
[–] livingcoder@programming.dev 8 points 5 days ago* (last edited 5 days ago) (2 children)

I don't know anything about screen. I think it would be great if you included a nice README.md file in the root of your repo for explaining what screen is and what your repo does both differently and the same. Please let me know if you do that. I'll come and check out the repo at that point - kinda hard for me to want to jump directly into the code at the moment.

[–] CameronDev@programming.dev 7 points 5 days ago (1 children)

I had thought screen was pretty commonly known, but its a tool you can use to background and reconnect to a process, with the child process being completely separated from your shell. So you can ssh into a box, start a process with screen, and then logout, return later and reconnect. (It also does other stuff like read from serial consoles)

Codewise, there isnt a lot there, 3 main files (main.rs, server.rs and client.rs) all weighing in at ~200 lines.

It felt premature to add a readme at this stagr, as I dont see this as a complete thing yet, but I can add a readme later today.

[–] livingcoder@programming.dev 3 points 5 days ago

Thanks for the explanation and README. I'll check it out.

[–] some_guy@lemmy.sdf.org 1 points 5 days ago (1 children)

If you're someone who might use this tool, you're likely on a system that can run man screen. I agree that readme-s are useful. But just run man screen, find out what the tool is, be done. Otherwise, I think you're asking the creator to do more work while I suspect you aren't the target audience.

[–] livingcoder@programming.dev 1 points 5 days ago (1 children)

That's an interesting take. I didn't know that the tool screen even existed, so I had no idea that it would be nice to have in my toolbelt for future needs. A README also helps those that may already know a lot about screen and want to know the differences between screen and their implementation.

There is nothing better in open source than a thorough, well-written README at the root of the project. Wanting others who don't understand the source of the inspiration to be completely clueless is unfriendly (at best).

[–] some_guy@lemmy.sdf.org 1 points 5 days ago (1 children)

I'm pointing out that there is information available without asking the creator to explain it rather than suggesting that a readme shouldn't be created. In software development, one of the primary skills is knowing where to find information yourself before interrupting others. I'm not suggesting that one shouldn't ask for help; quite the opposite. I'm just trying to provide an answer as a third-party who is not in a position to author a readme. I don't consider that unfriendly.

Information available at a disused lavatory at the end of a long corridor with a sing that warns "beware of the leapord"