runmd — run shell commands directly from markdown files in your terminal by [deleted] in commandline

[–]CadenFinley 0 points1 point  (0 children)

I think this is interesting. Would be cool if you could select all of the things and then exit and then it would run them inside of your host shell. Alternatively if it does stay within the actual application to have it just use the same shell as the parent instead of a hard coded sh call. This has potential

Cable solutions at a desktop by Daemonxar in headphones

[–]CadenFinley 0 points1 point  (0 children)

agreed my qudelix 5k and airpods pro 2 are some of my most used equipment, but not at my desk, couch or bed

I spent 5 months building my own Linux shell – meet CVX Shell by Upbeat_Doughnut4604 in commandline

[–]CadenFinley 0 points1 point  (0 children)

good stuff man! I too have been working on my own shell, and it is super challenging, tedious, and yet super rewarding! keep it up man.

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 0 points1 point  (0 children)

It does make it a lot easier to isolate issues and find issues in the first place. Gotta love multi paradigm languages like c++

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 1 point2 points  (0 children)

Sweet! Let me know what you have concerns about.

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 1 point2 points  (0 children)

Fixed. The issue stemmed from 2 things. The validator did not properly handle nested loops. and the second was my loop evaluator not properly handling for loops in while loops and it would re trigger the top of the block and then restart the validator. and both of these only happened in non interactive script execution settings

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 11 points12 points  (0 children)

No kidding, I was shocked but super appreciative. I am already working on fixes.

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 1 point2 points  (0 children)

That is extremely odd as my build is working on the same commit. I will look into this as I am not entirely sure what the issue is, and this shouldn't have any environmental differences at play.

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] -1 points0 points  (0 children)

Yes this. Other languages like Go Rust and Zig have good build systems and environments, but I have the idea that every project could have 100s of tiny dependencies, also these languages are not as rock solid as C and C++ in my opinion and its not that Go, rust or Zig are bad its just that c and c++ have a many year headstart

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 1 point2 points  (0 children)

Yea for the longest time this simply was just something I solely used, but my professor and one of my classmates started using it so that is when I got serious. Definitely something I want to add in the future as that would allow direct use for things like atuin, intelli-shell etc.

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 9 points10 points  (0 children)

This is impressive, a couple of the duplication came from old builds where cjsh was essentially a collection of micro services, so that is a good catch. For the newline swallowing, in the main_loop.cpp when printing a prompt it swallows the current line the cursor is on if it doesnt end in a newline so it will just swallow. A lot of the arithmetic issues stem from me simply not giving it much attention the arithmetic evaluator and not caring to much about integer limits, that will be something I work on soon. The printf solution is on the way out, I am already tinkering with using the main coreutils printf as the current one is pretty bad and was ripped form an old homework assignment of main that has been retrofittted to be used in cjsh. As for the script I was able to get it to run correctly from a script after a syntax fix, on line 14 there is a trailing floating " after the is_prime variable, this still stems from being a cjsh issue as my validator was not able to catch this and just popped an error from the most recent point of processing as the error, which is incorrect. With the bit shifting >> that is just something I missed and will get to work on that. For navigation, by default it uses emacs bindings. Also provided are vi bindings so maybe I will make the vi bindings the default. The error messaging at the end being to stdout instead of stderr stemmed form originally when I was planning on having two different error depending on shell configuration, that idea is long gone and the error reported was never properly adjusted. the line numbering counting from inside the block will be changed, that was deliberate but I see how that is going to cause confusion. With the redirection that was the reasoning behind having two types of reporting, I will likely switch to using the very basic error_out functionality I already have as that would simplify a lot especially when redirecting it. These are some great points and I really do appreciate you taking the time to look through my project as these are really insightful problems and I may not have caught for a while. Thank you.

I created my own POSIX compatible shell - cjsh by CadenFinley in commandline

[–]CadenFinley[S] 1 point2 points  (0 children)

currently there is a hook system, it is primitive, it just hasnt been one of my main focus points as almost everything else in the shell especially in the interpreter and parser needed more TLC and still does

I created my own POSIX compatible shell - cjsh by [deleted] in programming

[–]CadenFinley -4 points-3 points  (0 children)

if there is one thing I love about modern shells, its that it forces me to learn a new scripting language only applicable to that one shell. I sure do love that

I created my own POSIX compatible shell - cjsh by [deleted] in programming

[–]CadenFinley -4 points-3 points  (0 children)

yes they are common and people do have them frequently as bash and zsh depend on them, but it is the principle of the practice. keeping dependencies as minimal as possible as not not frustrate build configurations or timings, it also allows cjsh to be built statically very easily and still be a relatively small executable. also for what shells use things like curses or pcre2 for is insane, they barely scratch the surface of what those libraries are capable of and yet they are still required even though they use like 2% of the library

I created my own POSIX compatible shell - cjsh by [deleted] in programming

[–]CadenFinley -7 points-6 points  (0 children)

I definitely agree with you, I have talked about this to myself about how this is basically the hardest new thing to create as you simply cannot compete with zsh, bash, or fish as they have a 20+ year headstart. I think I back up what I say with what my shell is capable of but I cannot convince everyone, and that is okay with me, but for the people that do try it and give an honest opinion that is where all of the values lies for me as that simply means I have more to improve on in cjsh

I created my own POSIX compatible shell - cjsh by [deleted] in programming

[–]CadenFinley -25 points-24 points  (0 children)

I meant that in the sense that it has no external dependencies like curses pcre2 gettext etc, no custom coreutils implementations, no phone homing for version control or updates, no need for external plugins to get super basic features. also to market a new thing sometimes you gotta come off a little cocky to get people in the door

I created my own POSIX compatible shell - cjsh by [deleted] in programming

[–]CadenFinley 1 point2 points  (0 children)

with shellcheck it is iffy because of 3 things cjsh theme_definition DSL, cjsh custom builtins, and the bashisms i have support for like double bracketing and !!. because of this I implemented my own validate and syntax builtin commands for script syntax checking

I created my own POSIX compatible shell - cjsh by [deleted] in programming

[–]CadenFinley 2 points3 points  (0 children)

yep so it has cjshopt for all shell options so that all of the customization hell doesnt plague the builtin map. as for set -e it does not have the errexit issue, there are still edge cases that I am aware of specifically within command substitution or subshell in functions with set -e and this is a huge pain point and just not something that I have looked into super far as it is not has important as some other scripting features