ncurses

Building HelloWorld C++ Program in Linux with ncurses

二次信任 提交于 2019-12-06 04:13:13
问题 I successfully ran sudo apt-get install libncurses5-dev Within my Eclipse window I then try to build the following HelloWord.cpp program: #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; } I get the following error: Invoking: GCC C++ Linker g++ -m32 -lncurses -L/opt/lib -o "Test_V" ./src/curseTest.o

tmux在busybox上的移植

左心房为你撑大大i 提交于 2019-12-06 03:43:09
作者:彭东林 邮箱:pengdonglin137@163.com 参考 https://gist.github.com/tessus/5e118d44261a6ab2f198 环境 Qemu-4.1 Linux-4.14 ARM64 aarch64-linux-gnu-gcc 8.3 概述   在进行嵌入式开始时,经常会用到串口,这样就可以使用串口来登录到板子上,但是如果通过一个串口实现多个终端的功能的话,对于我们的开发调试就会更加方便,而tmux就提供了这样的功能。   下面介绍tmux如何静态交叉编译,使其运行在arm开发板上。 软件版本 tmux-2.1 libevent:2.1.10 ncurses-6.1 正文 交叉编译tmux需要libevent和ncurses两个软件包。 下载和编译libevent 1、下载libevent: https://github.com/libevent/libevent/releases/download/release-2.1.10-stable/libevent-2.1.10-stable.tar.gz 2、解压和交叉编译,下面是编译脚本: 1 ./configure --prefix=`pwd` \ 2 --host=aarch64-linux-gnu \ 3 --disable-shared 4 5 make 6 make

Getting 256 colors out of ruby-ncurses

大城市里の小女人 提交于 2019-12-05 23:57:47
问题 I've got 256 colors working great in my terminal (test scripts here), but it stops working when I use ncurses (via Ruby-ncurses). Printing the escape sequences given on that page works fine, but when I initialize ncurses 'puts' stops working and I can't output the colors with any of the various ncurses color changing/string output functions I've found. What gives? 回答1: I am not sure if this would be all the story, but make sure your terminal capabilities do indeed provide for the 256 colors

Ncurses program exits when terminal resized

北城以北 提交于 2019-12-05 21:58:37
When i resize my terminal window, the below program exits. Why and how can stop it? #include <ncurses.h> #include <unistd.h> int main () { initscr (); printw ("Some text\n"); refresh (); sleep (100); endwin (); return 0; } I found the answer here When terminal has resized, the SIGWINCH signal raises and program exits. Here is the solution: #include <ncurses.h> #include <unistd.h> #include <signal.h> int main () { initscr (); signal (SIGWINCH, NULL); printw ("Some text\n"); refresh (); sleep (100); endwin (); return 0; } You need to handle the SIGWINCH signal : #include <signal.h> /* resizer

Cannot link ncurses while compiling vim

眉间皱痕 提交于 2019-12-05 17:51:14
I'm trying to compile vim 7.3 in home directory. As a terminal library, I installed ncurses in ~/lib/ncurses/ncurses-5.9 with --with-shared option. After setting set path = ( ~/lib/ncurses/ncurses-5.9/bin/ $path ) setenv LD_LIBRARY_PATH ~/lib/ncurses/ncurses-5.9/lib/:$LD_LIBRARY_PATH I tried to configure vim with ./configure --enable-multibyte --prefix=/home/******/apps/vim/vim73 or ./configure --enable-multibyte --prefix=/home/******/apps/vim/vim73 --with-tlib=ncurses however it failes while searching for ncurses. It seems -lncurses flag is unavailable, and ldconfig did not help. I do not see

Printing inside window, not on borders

大兔子大兔子 提交于 2019-12-05 17:03:32
问题 I'm trying to write something inside a curses window, but it seems to write on borders too. How can I fix the code below? win_self = newwin(LINES / 2, COLS, 0, 0); box(win_self, 0, 0); wrefresh(win_self); wprintw(win_self, "foobar"); 回答1: In curses, the borders generated by box() are inside borders. As far as I can tell, there's no way to simply say "don't overwrite my border". Nevertheless, there are three solutions that I can think of right now: don't overwrite the border characters (use

using curses with raw_input in python

假装没事ソ 提交于 2019-12-05 14:39:41
In my python linux console application I use curses to handle displaying of data. At the same time I'd like to have an input line to enter commands, pretty much in good ol' irssi-style. With default curses getch() I'd have to do a lot of coding just to get the basic funcionality of raw_input function - arrow keys to move cursor / browse through the input history. Is there a simple way to get such behavior working with curses, as it captures input events and I can't just use functions that read sys.stdin. Use curses.textpad http://www.python.org/doc/2.4.1/lib/module-curses.textpad.html 来源:

RabbitMQ安装

别说谁变了你拦得住时间么 提交于 2019-12-05 13:43:30
1.进入http://www.erlang.org/downloads 下载 Erlang,因为RabbitMQ 是由 Erlang 语言编写的。 2.tar zxvf otp_src_19.3.tar.gz 3.cd otp_src_19.3.tar.gz 4../configure --prefix=/opt/erlang 5.(遇到No ... found)yum install nucress-devel 3.(安装Erlang) make 7.make install 8.(遇到Makefile:248: /usr/local/otp_src_18.1/make/x86_64-unknown-linux-gnu/otp_ded.mk: No such file)yum install ncurses-devel.x86_64 9../configure --prefix=/hwd/software/erlang make make install 10.修改/etc/profile配置文件,添加: ERLANG_HOME=/opt/install export PAHT=$PATH:$ERLANG_HOME/bin export ERLANG_HOME source /etc/profile 11.验证 Erlang 是否安装成功:erl 来源: https://my

using ncurses in a virtual terminal

瘦欲@ 提交于 2019-12-05 09:18:15
I'm new to Linux and virtual terminals as well as to Curses, so please forgive me if this description isn't clear as it could be. I'm trying to use Curses on Fedora 12 to output status information to a virtual terminal (you know one of the terminals you can get to by pressing ctrl-alt-Fx). When I start up my application on one of the virtual terminals ($TERM=linux), the lines for the boxes come out as the characters 'j', 'q', 'k'....(and a few other characters). Yet when I start it within a terminal window ($TERM=xterm), everything displays as it should. Can someone explain to me what I need

Ncurses and realtime (implemented in C, unix)

橙三吉。 提交于 2019-12-05 09:13:29
I am trying to implement a game using ncurses in C. I have to show the current time (the time must update each second) and my while loop looks like this while(1) { clk = time(NULL); cur_time = localtime(&clk); mvprintw(0,1,"%d %d %d",cur_time->tm_hour,cur_time->tm_min,cur_time->tm_sec); int key = getch() //other stuff } My problem is that the time will refresh only when I press a key. Is it a way to make the time refresh without the need of pressing a key (and to implement this in the same while)? There are a couple of functions you could use: nodelay timeout int nodelay(WINDOW *win, bool bf);