ncurses

ncurses- KEY_ENTER is fail

北城以北 提交于 2019-12-10 12:50:08
问题 I've been trying to teach myself ncurses and I'm loving it so far. However, I'm trying to write a small little text editor like pico or nano. I've got it set up fairly well so far. I created a function to map the keys. No matter what I do I can not get a response from KEY_ENTER. Whenever I press it it just goes to the beginning of the currently line that I'm on. I've tried using raw(); and using 13 instead of "KEY_ENTER" no luck. All the other keys respond as expected. I would appreciate any

Best gem for working with ncurses and ruby

坚强是说给别人听的谎言 提交于 2019-12-10 12:45:58
问题 I am interested in creating a command line application with ruby that would require moderately complex interaction with the user. I would like to use ncurses for this. What is the best gem for working with ruby and ncurses, or should I be using stdlib utilities in ruby? 回答1: Ruby includes bindings for the curses library. Despite what the name implies, it will use ncurses if possible. Third party libraries often provide abstractions on top of either Ruby's curses or their own bindings. For

ncurses trapping extended keys (Control-left, Shift-Function etc)

微笑、不失礼 提交于 2019-12-10 11:31:48
问题 I am trying to trap Control-Left, Shift-F10 etc in my ruby programs. Normally, using just getch I get a list of ints such as 27,91,50,50,126 which works. However I fear these may be system or terminal dependent. After googling I found about use_extended_names, tigetstr etc. I found a C program using these which discovers the keycodes at run time (by Thomas Dickey). I run it and it seems to discover extended keys, but then the getch in the same program still gives me the usual list of ints

Printing double-size characters with Ncurses

时光总嘲笑我的痴心妄想 提交于 2019-12-10 11:05:01
问题 Many terminal emulators (xterm, Konsole) support double-size characters. Ncurses does not support this and as far as I know, ncurses will not print escape characters (\033 will be unescaped and printed in clear text). Is it possible at all to print double-size characters in a ncurses application? 回答1: The "double-size" character capability you refer to is set by the following ANSI sequences (found here): ESC # 3 DEC double-height line, top half (DECDHL) ESC # 4 DEC double-height line, bottom

Urwid: make cursor invisible

╄→гoц情女王★ 提交于 2019-12-10 04:35:24
问题 I'm using urwid, which is a Python "framework" for designing terminal user interfaces in ncurses. There's one thing though that I'm not able to do in urwid that was easy in curses - make the cursor invisible. As it is now, the cursor is visible when selecting buttons, and it just looks plain ugly. Is there a way to disable it? 回答1: urwid uses the curs_set function, but does not expose it as a class method anywhere. Someone could modify urwid to allow using this method; otherwise there's no

cmake does non link ncurses

别说谁变了你拦得住时间么 提交于 2019-12-10 03:28:56
问题 I am a total noob concerning cmake. My CMakeLists is really basic: cmake_minimum_required(VERSION 2.4.6) #set the default path for built executables to the "bin" directory set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) #set the default path for built libraries to the "lib" directory set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) #For the Curses library to load: SET(CURSES_USE_NCURSES TRUE) include_directories( "src/" ) add_subdirectory(src) when I make the linker does not find the

CLion run program in separate system terminal

匆匆过客 提交于 2019-12-10 01:36:39
问题 I have an ncurses program that I'd like to interactively debug using CLion. The problem is that when I run the program in CLion to debug it, the inbuilt console where the program is run doesn't display the output of the ncurses program properly. I'd like to have the program run in my systems terminal so I can see the output properly whilst debugging the program with CLions debugger. Is there any way to do this? 回答1: The best way to accomplish this is to use GDB now it can be really

Is there a way to force a console application to run at a certain window size (using Pdcurses)?

余生颓废 提交于 2019-12-09 23:49:39
问题 I'm trying my hand at throwing together a minor roguelike in C++, but I've run into a problem - in order to get the game to display correctly, the console window has to be a bit wide (around 45 rows, 115 cols). It's easy enough to change by right clicking on the menu bar and setting the defaults for windows with the same name, but is there a way I could set it automatically from the code so I don't have to ask potential users to mess with that? I'm using Pdcurses to handle output, if that

Working with curses in IPython. How can I improve this?

孤街醉人 提交于 2019-12-09 11:47:54
问题 I've found a way to interactively work with curses while still enjoying most of the benefits of IPython. It works, with some limitations, but not as well as I'd like. The original problem, of course, is that I'd like to be able to work with my interactive Python session while having it control a terminal screen, using the curses (ncurses) module (or urwid, for example). One solution is to write a simple TCP server with a simple event loop that evaluates each string it reads from the socket

How to delete text after getstr() c++ ncurses

笑着哭i 提交于 2019-12-08 10:50:30
问题 I have been learning to use the ncurses library and I have come across getstr(). I was wondering how you would erase the text from getstr() on the terminal after the value has already been stored in a variable? I have tried to find the answer on google but no luck! Basically I want it so when the user presses enter the text will be removed from the screen. 回答1: As far as I know, ncurses has two functions, gotoxy() and getxy() , which let you jump to every position of the screen and tell you