ncurses

ncurses can't find any documentation on cchar_t

≡放荡痞女 提交于 2021-01-28 11:01:03
问题 I am trying to read a char from my ncurses terminal with mvin_wch() which returns a cchar_t, I know this is a struct with stuff like color information and a wchar_t. I can't seem to find any information about this cchar_t. I just wan't to know what it's members are named. I don't get why such an important part of the ncursesw library isn't documented anywhere. 回答1: If you have to know, read curses.h , but as noted, you are expected to manipulate cchar_t using the library calls, e.g., setcchar

Add a scrollbar on Ncurses or make it like “more”

荒凉一梦 提交于 2021-01-27 06:04:11
问题 Basically I am writing a client program which receives response and logs from server, the client is also able to send request to server for different information. I used curses and output looks pretty good. It looks like VI, output at the top and user on Client end enter command at the bottom. Only thing is I am not able to scroll back.. My boss told me to make it like "more command in linux" and I want to stick with my solution and add a scroll bar on the side for output window... I was

Terminal color using terminfo?

半腔热情 提交于 2021-01-23 06:36:05
问题 I am writing a C++ class permitting the usage of color in terminal. I want it works on every terminal : printing with true color (24 bits) on terminals that supports it, with 256 color (6x6x6) on terminals that supports it, else with the basic 16 colors. I wrote once C functions using termcap, and I thought using it in this case. However, the man page says : The termcap database is an obsolete facility for describing the capabilities of character-cell terminals and printers. It is retained

代码雨

最后都变了- 提交于 2021-01-14 16:53:59
YUM安装必要软件 yum install -y gcc gcc-c++ kernel-devel-3.10.0-1127.19.1.el7.x86_64 autoconf automake libtool ncurses-devel ncurses 有问题再执行 rm /var/run/yum.pid -f 建立文件夹 mkdir /root/hky 复制源码到 /root/hky/ cd /root/hky 解压源码 tar -xvf cmatrix-2.0.tar.gz 进行源码文件夹 cd cmatrix-2.0/ 更新编译源码当前目录下系统文件 autoreconf -i 设定软件安装文件为默认文件夹 ./configure 编译源码 make 编译安装 make install 运行代码雨 cmatrix 来源: oschina 链接: https://my.oschina.net/u/4323266/blog/4899115

ncurses newterm following openpty

依然范特西╮ 提交于 2020-12-27 06:16:20
问题 I am trying to figure out how to do the following: create a new pseudo-terminal open a ncurses screen running inside the (slave) pseudo terminal fork A) forward I/O from the terminal the program is running in (bash) to the new (slave) terminal OR B) exit leaving the ncurses program running in the new pty. Can anyone provide pointers to what I might be doing wrong or that would make sense of some of this or even better an example program using newterm() with either posix_openpt(), openpty() or

C++ code reduction for identical submenus

荒凉一梦 提交于 2020-12-08 05:15:27
问题 I am coding my way to the last project of the semester and I have a code duplication issue. I am using ncurses or pdcurses to make a menu to interact with the user. The problem: For each choice of the menu(Five in total) I need a submenu. The submenu's only difference from the main menu is, the array of Items to be printed, and the parameters that go into some functions, as a result of the Items array size. Since I need five submenus, I need five times the same code(six if you add the main

Lua之Lua安装与Lua变量-TTLSA(一)

自作多情 提交于 2020-12-04 23:55:58
公司业务有用到Lua,与nginx结合起来实现高性能的web应用,想去弄懂这方面的知识,就去了解学习了下Lua,欢迎大咔们指教。 1. Lua介绍 Lua是一门简单的编程语言,它的优势在于可以整合C++的模块来扩展自身的功能,使用数百行或更少的代码来解决复杂的问题。具有的特征有: 1.1. 可扩展性:Lua从一开始就被设计成易于扩展的语言,很多功能都是通过外部库来实现的,很容易与其他编程语言如C、C++、Java等等进行交互。 1.2. 简洁: Lua十分简洁,但是功能强大,易于学习,很适合小规模的应用。 1.3. 高效: Lua有很高的执行效率。 1.4. 可移植性: Lua可以运行在任何现有的系统上。 Lua脚本是包含一系列Lua命令的简单脚本,扩展名为.lua的文本文件。单个命令或者一系列命令组成的脚本文件,在Lua中我们把它称为代码块。 代码块:指一个控制结构内,一个函数体,或者一个chunk(变量被声明的那个文件或者文本串)。 2. Lua安装 先把Lua环境搭建起来,便于后面学习演示。 # curl -R -O http://www.lua.org/ftp/lua-5.2.3.tar.gz # tar zxvf lua-5.2.3.tar.gz # cd lua-5.2.3/src # make linux 2.2 常见问题解决方法 问题1: lua.c:67:31:

Lua之Lua安装与Lua变量-TTLSA(一)

半腔热情 提交于 2020-12-04 08:56:15
公司业务有用到Lua,与nginx结合起来实现高性能的web应用,想去弄懂这方面的知识,就去了解学习了下Lua,欢迎大咔们指教。 1. Lua介绍 Lua是一门简单的编程语言,它的优势在于可以整合C++的模块来扩展自身的功能,使用数百行或更少的代码来解决复杂的问题。具有的特征有: 1.1. 可扩展性:Lua从一开始就被设计成易于扩展的语言,很多功能都是通过外部库来实现的,很容易与其他编程语言如C、C++、Java等等进行交互。 1.2. 简洁: Lua十分简洁,但是功能强大,易于学习,很适合小规模的应用。 1.3. 高效: Lua有很高的执行效率。 1.4. 可移植性: Lua可以运行在任何现有的系统上。 Lua脚本是包含一系列Lua命令的简单脚本,扩展名为.lua的文本文件。单个命令或者一系列命令组成的脚本文件,在Lua中我们把它称为代码块。 代码块:指一个控制结构内,一个函数体,或者一个chunk(变量被声明的那个文件或者文本串)。 2. Lua安装 先把Lua环境搭建起来,便于后面学习演示。 # curl -R -O http://www.lua.org/ftp/lua-5.2.3.tar.gz # tar zxvf lua-5.2.3.tar.gz # cd lua-5.2.3/src # make linux 2.2 常见问题解决方法 问题1: lua.c:67:31:

Linux流量监控工具

别等时光非礼了梦想. 提交于 2020-11-22 03:04:11
一、iftop是什么? iftop 是类似于top的实时流量监控工具。 官方网站: http://www.ex-parrot.com/~pdw/iftop/ 二、iftop有什么用? iftop 可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息等,详细的将会在后面的使用参数中说明。 三、安装iftop 安装方法1、 编译安装 如果采用编译安装可以到 iftop官网 下载最新的源码包。 安装前需要已经安装好基本的编译所需的环境,比如make、gcc、autoconf等。安装iftop还需要安装libpcap和libcurses。 CentOS上安装所需依赖包: yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel Debian上安装所需依赖包: apt-get install flex byacc libpcap0.8 libncurses5 下载iftop wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz tar zxvf iftop-0.17.tar.gz cd iftop-0.17 ./configure make && make install 安装方法2:(懒人办法,最简单)

Linux下流量监控:iftop的安装与使用

半城伤御伤魂 提交于 2020-11-21 06:54:05
1.简介 iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts. Handy for answering the question "why is our ADSL link so slow?". iftop监听网络(和top监听cpu使用状态类似),通过监听指定的网口,来展示当前的带宽使用率,用于解答"您的adsl网络链接为何如此之慢”的问题 项目地址: http://www.ex-parrot.com/pdw/iftop/ 用途 对定位机器上的流量异常问题,和服务间调用问题比较有用。 2.安装 有两种安装方式 1. yum/apt安装 2.源码编译安装 2.1 yum/apt #Ubuntusudo apt install -y iftop/xenial #Centossudo yum install -y iftop.x86_64 2.2 源码编译安装 2.2.1 预装系统包 #Ubuntusudo apt-get install flex byacc libpcap0.8