ncurses

G++ can't find references to raw() or cbreak(), even when linking curses [duplicate]

荒凉一梦 提交于 2019-12-20 03:20:01
问题 This question already has an answer here : DSO missing from command line [duplicate] (1 answer) Closed 2 years ago . I'm having trouble getting some absolute basic work with curses.h done, even though I've worked with it before. I'm sure it's a classic case of missing something small, but I'm at my wit's end. G++ absolutely won't recognize the functions raw() or cbreak(), even though curses.h is included in my .cpp and header file, and linked to when compiling with (minimal version): g++

get the text in the display with ncurses

旧时模样 提交于 2019-12-20 02:28:13
问题 Is there any way to get back the characters outputted into a variable on ncurses ? let's say I do: printw("test"); then I want to be able to: somefunc(strbuffer); printf("%s",strbuffer); // test I need a function to get back all characters on the screen into a variable, scr_dump get's close but the output format is unreadable.. 回答1: If you put stuff on the screen using curses functions (e.g. addch, mvaddch, addstr) you can use inchstr) and related functions to read the characters from the

Cross platform solution for automating ncurses-type telnet sessions

你离开我真会死。 提交于 2019-12-20 01:13:19
问题 Background Part of my work in networking and telco involves automating telnet sessions when legacy hardware doesn't offer easy solutions in other interfaces. Many older pieces of equipment can only be accessed via craft ports (RS-232 serial ports), SNMP, or telnet. Sometimes telnet is the only way to access specific information, however telnet is designed as a human interface and thus requires screen scraping. In addition, there is also the issue of scraping screens where only portions are

Debugging ncurses with Eclipse CDT

你。 提交于 2019-12-19 16:16:18
问题 I'm writing a C++ application using ncurses in Eclipse CDT however I can't run/debug my app in eclipse because the console in eclipse does not work with curses. My app runs fine if I run it from a terminal but I just added some new code and now I'm getting a segmentation fault so I'd like to use the debugger in eclipse to help me fix the issue. Is there a way to have eclipse run/debug my application but use a different terminal for the output much like when you do "tty /dev/pts/1" in gdb? Or

Debugging ncurses with Eclipse CDT

浪尽此生 提交于 2019-12-19 16:16:06
问题 I'm writing a C++ application using ncurses in Eclipse CDT however I can't run/debug my app in eclipse because the console in eclipse does not work with curses. My app runs fine if I run it from a terminal but I just added some new code and now I'm getting a segmentation fault so I'd like to use the debugger in eclipse to help me fix the issue. Is there a way to have eclipse run/debug my application but use a different terminal for the output much like when you do "tty /dev/pts/1" in gdb? Or

Building Vim from Source in Cygwin

只谈情不闲聊 提交于 2019-12-18 17:56:25
问题 I am trying to build Vim from the source packages, under Cygwin, to enable Python support. I am following the instructions given here, but I'm hitting this error when I run the configure script: checking --with-tlib argument... empty: automatic terminal library selection checking for tgetent in -lncurses... no checking for tgetent in -ltermlib... no checking for tgetent in -ltermcap... no checking for tgetent in -lcurses... no no terminal library found checking for tgetent()... configure:

ncurses and stdin blocking

笑着哭i 提交于 2019-12-18 13:36:46
问题 I have stdin in a select() set and I want to take a string from stdin whenever the user types it and hits Enter . But select is triggering stdin as ready to read before Enter is hit, and, in rare cases, before anything is typed at all. This hangs my program on getstr() until I hit Enter . I tried setting nocbreak() and it's perfect really except that nothing gets echoed to the screen so I can't see what I'm typing. And setting echo() doesn't change that. I also tried using timeout(0) , but

How to set console cursor position for stdout

二次信任 提交于 2019-12-18 07:03:17
问题 I want to set cursor position to print a char on console screen. Is there a solution without using ncurses library. Is there an equivalent call for SetConsoleCursorPosition in Linux from example below: void print (int x, int y, char c) { COORD p = { x, y }; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), p); printf("%c", c); } 回答1: Perhaps a little history is in order. What you call the “console” in Windows is really an example of a terminal emulator; however, unlike traditional

ANSI colors in C and ncurses

拜拜、爱过 提交于 2019-12-18 06:13:57
问题 I know I can do the attron and attroff with the color I choose to, however, I would like to know if it's possible to do it with the ANSI colour escape codes within ncurses: #include <stdio.h> #include <ncurses.h> int main() { initscr(); char *s2 = NULL; const char *s1 = "World"; int n = 10; // What would be a good way to colour %d? // seems it is not safe to us the ANSI color escape in here... s2 = malloc (snprintf (NULL, 0, "Hello %s \033[22;31m%d", s1, n) + 2); sprintf (s2, "Hello %s \033

how to get a character from stdin without waiting for user to put it? [duplicate]

不羁岁月 提交于 2019-12-18 04:21:34
问题 This question already has answers here : How to avoid pressing enter with getchar() (11 answers) Closed 3 years ago . I'm writing a C program that prints something on terminal using ncurses. It should stop printing when user press 's' and continue again when press 's'. How can I read a key from input without waiting user to press the key? I tried getch() and getchar() but they wait until a key is pressed... Edit This is my code: int main(void) { initscr(); /* Start curses mode */ refresh(); /