jovanbulck / jsh

A basic UNIX shell implementation in C
GNU General Public License v3.0
30 stars 10 forks source link

--fun-mode flag for, well, fun #48

Open GijsTimmers opened 9 years ago

GijsTimmers commented 9 years ago

We should create a --fun-mode, for experimenting with cool stuff. For example:

jovanbulck commented 9 years ago

:+1:
We should also detect automatically in the Makefile whether it is a mac and then if a user types exit don't exit, but display "[Process completed]" and don't exit, but go in an infinite loop ;-)

mac terminal

GijsTimmers commented 9 years ago

Also: replace cat by lolcat, if possible. See attached screenshot. Doing so would require lolcat as a dependency in packaging. scrot

GijsTimmers commented 9 years ago

I have a better idea for exiting with an error status: bring back the system beep, or play this beep-compilation

jovanbulck commented 9 years ago

I have thought about this. I think it's probably a bad idea to hard include more and vague dependencies such as lolcat, sl, beep, etc. injsh`. This doesn't mean we can't build a funmode, rather we shouldn't hard-code it.

A promising idea, I think, is to include some kind of hooks onto several jsh-events. Let me explain: jsh would offer some way (e.g. ~/.jshrc) for a user to register a shell-command-string as a "hook" for a specific "jsh-event". This shell command string should then be interpreted from within the jsh source, every time the specified "jsh-event" happens. This way we would have a mechanism to allow a user to customize the shell's behavior.

A (non-exhaustive) list of possible "jsh-events" could for example be:

This wouldn't be too hard to implement, I think. Some built_ins for setting the hooks and then some interface header file for hooks probably and calling the hook_methods at the right time in the source code...

GijsTimmers commented 9 years ago

You're making a huge mistake.

jovanbulck commented 9 years ago

tell me more

GijsTimmers commented 9 years ago

fine