tui

Python hide already printed text

白昼怎懂夜的黑 提交于 2021-01-28 14:28:19
问题 I'm creating a simple two-player board game where each player must place pieces on their own boards. What I would like to do is by either: opening a new terminal window (regardless which OS the program is run on) for both players so that the board is saved within a variable but the other player cannot scroll up to see where they placed their pieces. clearing the current terminal completely so that neither player could scroll and see the other player's board. I am aware of the unix 'clear'

Interrupt (n)curses getch on incoming signal

╄→尐↘猪︶ㄣ 提交于 2020-01-02 00:54:11
问题 One of my programs uses ncurses for drawing a small tui. One of my goals is to make it rather portable to other curses implementations. This means that I want to catch a SIGWINCH issued by the terminal emulator on a resize operation myself and update my tui to adhere the changed geometry (and not depend on the resizing facilities of ncurses). Since POSIX (as far as I know) only allows access to sig_atomic_t variables within the signal handler, I set one to a different state. In the main loop,

Cannot leave tui mode with Ctrl-X A nor see program output in tui mode

☆樱花仙子☆ 提交于 2019-12-29 07:27:08
问题 Problem A : I start gdb in command line with "gdb test" I press ctrl-x,ctrl-a before I do anything else Then I set break point using "b main" Then I start running the program using "r" Till this point, if I press the Up arrow key the src window will not scroll. Instead, something will appear in my command window - "^[0A". If I try to refresh the screen with ctrl-l, "^L" is what appears in the command window. I don't think this is supposed to happen. Under this situation I can't even quit tui

Keep script position in terminal

你说的曾经没有我的故事 提交于 2019-12-25 06:46:16
问题 I want to write a Powershell script that shows a few lines (maybe 5), but they stay in the same spot/position in the terminal window. For example: If I was writing a script that printed if a few devices were pingable, I wouldn't want the output to keep scrolling down the terminal; I would want each line to stay in the position they are in, but update over time. Ex: +----------------------+ +----------------------+ | TERMINAL | | TERMINAL | +----------------------+ +----------------------+ |

Highlighting and Selecting text with Python curses

我的梦境 提交于 2019-12-20 20:39:50
问题 This is my first post to stack overflow. I've been lurking this site for information for years, and it's always helpful, so I thought that I would post my first question. I've been searching for some similar examples, but can't seem to find anything. Ultimately, I'm trying to write a simple text ui for finding false positives and false negatives in a text extraction program. The false positive module is a simple yes/no selection, and displaying colored text and using getch() is easy enough.

Navigate using function call stack in gdb

此生再无相见时 提交于 2019-12-12 12:03:47
问题 In Visual Studio, if you click on an entry in the call stack, that opens editor and shows you the source code for that function. Is something similar possible in gdb? I use tui (text user interface) in gdb. Is it possible to make tui show source code for a given entry in backtrace? If not, then how do you make use of information in backtrace? Do you manually open the files and navigate to correct line? 回答1: When you stopped with gdb (in any mode) in breakpoint and can see backtrace with

Reading a text file character by character into a 2D array in Java

对着背影说爱祢 提交于 2019-12-11 13:57:24
问题 As part of my Object Oriented class, we are to design a Battleship game which uses a TUI to eventually implement a GUI. According to the design, we are to read the AI's ship locations from a text file that will look similar to the one b ABCDEFGHIJ 1 2 BBBB 3 4 C 5D C 6D 7AAAAA 8 SSS 9 0 Where the letters represent different ships. My current implementation of the game uses a 2 dimensional array of characters, so I would like to be able to read the text file and create the corresponding 2D

How to indicate that a urwid listbox has more items than displayed at the moment?

一曲冷凌霜 提交于 2019-12-11 00:36:44
问题 Is there a way to show a user that a urwid listbox has additional items above / below the dispalyed section? I'm thinking of something like a scrollbar that gives an idea of the number of entries. Or a separate bar at the top / bottom of the list box. If this behavior can not be implemented, what approaches are there to achieve this notification? During my research, I found this question, which tried to achieve eventually the same. The given answer seems to check if all elements are visible.

How do you combine multiple TUI forms to write more complex applications?

落爺英雄遲暮 提交于 2019-12-09 12:56:02
问题 I would like to write a program with a T ext-based U ser I nterface (TUI) that consists of several forms. The first form contains a "list". Each list element represents a button. If the respective button is pressed, another form should appear in which one can enter the data for the list entry. Then the first form is displayed again (with updated list entries). Here is my attempt, which uses the library npyscreen but does not return to the first form. The code does also not contain the logic

Interrupt (n)curses getch on incoming signal

这一生的挚爱 提交于 2019-12-05 01:26:48
One of my programs uses ncurses for drawing a small tui. One of my goals is to make it rather portable to other curses implementations. This means that I want to catch a SIGWINCH issued by the terminal emulator on a resize operation myself and update my tui to adhere the changed geometry (and not depend on the resizing facilities of ncurses). Since POSIX (as far as I know) only allows access to sig_atomic_t variables within the signal handler, I set one to a different state. In the main loop, my program checks whether the state has changed and updates the tui if necessary. But now, I have the