safeboot-loader icon indicating copy to clipboard operation
safeboot-loader copied to clipboard

How do I display the ncurses form?

Open DenisVASI9 opened this issue 2 years ago • 3 comments

I would like to draw a login box using python. I copied the python and ran the script, but nothing was shown on the screen.

import npyscreen
class TestApp(npyscreen.NPSApp):
    def main(self):
        # These lines create the form and populate it with widgets.
        # A fairly complex screen in only 8 or so lines of code - a line for each control.
        F  = npyscreen.Form(name = "LOGIN",)
        t  = F.add(npyscreen.TitleText, name = "Login:",)
        t  = F.add(npyscreen.TitlePassword, name = "Password:",)
        # This lets the user interact with the Form.
        F.edit()


if __name__ == "__main__":
    App = TestApp()
    App.run()

DenisVASI9 avatar Jan 15 '23 22:01 DenisVASI9

safeboot-loader doesn't include python, so I'm not sure where you want to run this application.

osresearch avatar Jan 16 '23 11:01 osresearch

I added python myself. After that I wrote an example in c and it doesn't work either.

#include <ncurses.h>

int main()
{	
	initscr();			/* Start curses mode 		  */
	printw("Hello World !!!");	/* Print Hello World		  */
	refresh();			/* Print it on to the real screen */
	getch();			/* Wait for user input */
	endwin();			/* End curses mode		  */

	return 0;
}
Error opening terminal: linux.

I did this directly in initrd

DenisVASI9 avatar Jan 16 '23 12:01 DenisVASI9

@osresearch What do you think of that?

DenisVASI9 avatar Jan 17 '23 12:01 DenisVASI9