Search code examples
pythoncncursescurses

printing to right side or bottom side of terminal using (n)curses


What's the standard way to print to the right side and/or bottom side of the terminal window using n/curses?

Here's a little sketch:

Terminal window:
================================================================================
                                                                         [ MSG ]













message number 2                                                   here is more
================================================================================

Solutions in C or Python are fine.

Thanks!


Solution

  • I'd go with:

    mvprintw(COLS-length("msg"),1,"msg");
    mvprintw(0,LINES-1,"message number 2");
    mvprintw(COLS-length("here is more"),LINES-1,"here is more");
    

    That's kinda off the cuff, which is how I do most of my curses programming.