Creating a command line "full screen"

I am wondering how to create the appearance of a “full-screen” window inside the shell, as in vim, emacs, etc. Can this be done programmatically in Ruby? And how does it depend on the platform?

Edit: I'm not looking for how to get my shell to work in full screen mode. I’m looking for a way to hide previous entered commands and “fill” the shell screen with an application. This is for the installer.

+6
source share
4 answers

What you're probably looking for is ncurses or S-Lang to provide you with a complete TUI .

The Ruby gem provides a few gems that could be explored:

 $ gem list --remote | grep -i curses cursesx (003) ffi-ncurses (0.4.0) ncurses (0.9.1) ncurses-ruby (1.2.1) ncursesw (1.2.4.3) snowleopard-ncurses (1.2.4) 

The author of the rbcurse package recommends using the ncurses-ruby gem . rbcurse provides some pre-written widgets and the ability to write new widgets in the same style - it looks very useful.

I have not yet found the S-Lang bindings for Ruby; based on the project’s focus on providing a language translator, I just don’t think it would be easy to create Ruby bindings. Sorry, because many application authors prefer S-Lang over ncurses.

+4
source

You can use ncurses for such things. It provides an abstraction layer for your terminal.

+1
source

Despite the fact that there is a much more cross-platform and elegant soul, the following works on Linux, as well as work on other Unixes:

 system("clear") 

If you are on Windows, this may work (not verified):

 system("cls") 

If you want to create an application that can update your interface, you can save some kind of array of characters:

 colArr=[] columNum.each {colArr<<[]} #fill colArr system("clear") print colArr #Every time you change it, call system("clear") then print colArr 

This is pretty manual, but it works for simple TUIs.

+1
source

try pressing the "F11" key .. or you can go to settings> display settings I just find a stream that says that. Let's go here

0
source

Source: https://habr.com/ru/post/908940/


All Articles