crystal-community / icr

Interactive console for Crystal programming language
MIT License
505 stars 40 forks source link

Added a "clear"-command to clear the screen #83

Closed Jens0512 closed 6 years ago

Jens0512 commented 6 years ago

Not too sure if the C-bindings work in every unix system, but i hope so.

veelenga commented 6 years ago

@Jens0512 thanks for your contribution.

Your change works for me on OS X and overall it is good, but could you please explain why we need this in ICR? Personally, I very rarely use clear command in a terminal and probably have never needed it in ICR/IRB or other REPLs.

Jens0512 commented 6 years ago

@veelenga Well, of course we don't need one. But i think some people would like to clean their screen sometimes, and some (like myself) are extremely frequent screen-cleaners. Im not so sure about the invoke though, "clean" is not an all that unusual method/function -name. And its probably better to just don't have a clear-command than changing the invoke to clean_screen or so 😅, but its a suggestion.

Edit: grammar

jwoertink commented 6 years ago

On Mac I just do cmd-k or cmd-l depending on my needs. On linux I think it's ctrl-shift-l. I'm totally on board with needing to clean the screen every 5 seconds, but I think keyboard shortcuts are a lot easier to do. I'm thinking maybe we do a community vote to see if this is something everyone would prefer?

Jens0512 commented 6 years ago

@jwoertink Well, to me it seems like the reasons for not having it are quite superior already.

Jens0512 commented 6 years ago

Closed as there was no need of the clear-command. Instead use cmd+k on mac, or ctrl-shift-l on linux

jwoertink commented 6 years ago

Cool, that works. Thanks for the contribution! Maybe you can help me out with #41 @Jens0512 😄