I've been trying to make my own terminal, and everything is fine. I've made the cd, ls, rm, rmdir, mkdir, etc... commands originally, but I want to make my terminal functional. E.g. I want a programmer to be able to find my terminal, or at least its code useful. So, I want to enable commands like nvim, python, gcc, g++ but the problem is that idk how to do that.
The 1 big problem with
if command == ...:
...
else:
os.system(command)
is that if the command is invalid, both in my terminal and in powershell, it will display powershell's error, making my terminal look like just a good-looking powershell, while all my commands are original.
I have my custom error code but if I use os.system(command) and command is some gibberish like fksdhfiashgkuahe4g then it will print both "*gibberish* is not an external or batch blah blah blah" and my custom error code right below it.
SUMMARY:
i want to use e.g. gcc, g++, nvim and all that in powershell but not display its errors in my terminal, only my own.
the terminal is infact made with python, so keep that in mind
THANK YOU SO MUCH FOR TAKING YOUR TIME TO READ ALL THAT, I REALLY APPRECIATE IT <3
(i know the answer may be easy but im stupid so... yeah :3)