Vaimer9 / vsh

A Unix shell written and implemented in rust 🦀
Mozilla Public License 2.0
93 stars 9 forks source link

[Draft] Git support #9

Open MalauD opened 2 years ago

MalauD commented 2 years ago

What i want to implement:

Some observation regarding this pr:

Vaimer9 commented 2 years ago

I do not think there is any other option than making an instance on every prompt, many shells are quite slow due to this reason. And on the topic of plugins, it absolutely makes sense to give the end user a stock prompt in the beginning and they can add plugins one by one to add up to their likings, but until vshlang is not implemented I do not think that would be possible, shipping rust binaries would be redundant so I will be implementing piping, inbuilt commands proc macro first then move on to creating the language.

Vaimer9 commented 2 years ago

I will review the code tomorrow, I don't think our time zones sync

Vaimer9 commented 2 years ago

I would recommend making a utils folder, the files that I have in the src dir contain the main functionality of the application. Having a git file would be out of place, this way you can also put highlight.rs in there maybe also utils.rs with another name

MalauD commented 2 years ago

Ok so i did what you said about file structures, tell me if it seems correct. I also added line of code modified visualization on the prompt but i think it's kinda superfluous. That's why i'm going to open a new pull request for runtime formatting (which might be related to a theme system) i will give more information on the pr description.

Vaimer9 commented 2 years ago

in src/utils/mod.rs do:

pub mod git;
pub mod highlight;
pub mod utils;

rather than

pub use {git::*, highlight::*, utils::*};
Vaimer9 commented 2 years ago

could you provide a screenshot of the prompt achieved with your new changes?

MalauD commented 2 years ago

for the mod.rs i don't think this is a good idea since we will have a lot of nesting in our project( e.g. crate::utils::utils::PromptEffects). So for a screenshot here is an example: updategit However, this not the final result since as i said i will do some templating to allowmaximum customization.

Can we have another mean of communication like slack or gitter, it will be more simple and avoid going back and forth on pr ?

Vaimer9 commented 2 years ago

sure I have a gitter account never used it much though, If you have discord I have it linked in my profile (vλimer9#0976)

Vaimer9 commented 2 years ago

https://gitter.im/Vaimer9/vsh here's the gitter link for vsh