1,023
questions
0
votes
0
answers
16
views
I receive error on nocbreak() returned ERR from curses library running a configuration tool
I am trying to run a configuration tool that uses curses, but I get some kind of error, where strace shows the following:
10:49:05.285312 write(2, "Traceback (most recent call last"..., ...
0
votes
0
answers
39
views
Maze generator and solver: go one by one and randomize the walls
When I run the code I get a maze kinda, the problem is that I want for each character in rows randomize between # and space, when space is the free path and # is the wall, but it gives out a shit ton ...
2
votes
0
answers
42
views
Error in using mitmproxy's http module in python
I have a code that uses mitmproxy http function and it miserably fails here:
def main(stdscr):
try:
parser = argparse.ArgumentParser(description='NetSour Network Analyzer')
parser....
1
vote
0
answers
45
views
Python Curses printing getkey() errors
The problem here is i can't get the exact letter i type in showing up in the console
I'm launching the code with CMD there is no problem launching the code
import curses
def main(stdscr):
stdscr....
0
votes
0
answers
43
views
The curses screen isnt looking as expected
So I was working on my Ubuntu a week ago and made this simple Python curses window that shows all of the files. The end result is expected to be a console file manager. The problem began when I booted ...
0
votes
0
answers
31
views
How to allow normal handling of CTRL+C on Windows using PDCurses?
As by the docs, I built PDCurses for Windows 32-bit using MinGW 14.1.0, outputting pdcurses.a. Apparently the mode nocbreak() should let CTRL+C be handled as a signal, closing the program, so I wrote ...
0
votes
0
answers
29
views
Outputting to curses' window from another function
Let's say I have set up two files.
One is main.py:
from .terminal import current_instance
current_instance.addstr("Hello world!")
current_instance.refresh()
Other is terminal.py:
import ...
2
votes
2
answers
66
views
Save and restore terminal window conent using Curses for Python
I'm making some console app on Python with Curses (window-curses) library. At some point I need to save window state (or maybe whole terminal state) to some object/variable and restore it in future.
...
0
votes
0
answers
39
views
How do I find the Curses Module
How do I find the "curses" module for python? I cannot find it anywhere and whatever I tried I could not obtain any useful results or information, I also checked in visual studio code ...
0
votes
0
answers
23
views
Understanding Conceptually How Python Curses Files Fit With Files Containing Functions
So i'm building a command line script for installing gentoo and along the way decided i'd like to in as well beautify it or create a python curses menu alongside what functions i have handling ...
0
votes
0
answers
56
views
curses.addch returning error but not indicating why
I'm writing a game in curses and for some reason I keep getting an error when trying to write to terminal. Previously I did not have a problem making the game boards in terminal. This issue started ...
1
vote
0
answers
100
views
Preventing cursor flickering in ncurses applications
I recently wrote an application in ncurses. In most of it, the cursor is disabled, but one part of it includes an editor (using forms), and the cursor is enabled for this (with visibility 2).
I have ...
2
votes
1
answer
152
views
Check for terminal resizing using ncurses under windows
I am using ncurses for a terminal application which should also be usable on windows but every time the user resizes the terminal everything is mashed. So I need a way to detect resizing and redraw.
...
0
votes
0
answers
50
views
Flickering entities in curses python
Hey i got a lot of entities drawn with curses, they move dynamically and after i changed some code to async (for movement speed functionality) entities sometimes are flickering. What could be the ...
0
votes
0
answers
32
views
curses.getch blocking while loop
I'm writing an application in terminal with use of curses library. It's working fine but i've got an idea of adding few keystrokes, and also of functionality where user can select entity on screen and ...
1
vote
1
answer
154
views
python - handle exceptions with curses wrapper
I'm following the documentation https://docs.python.org/3/howto/curses.html to setup a curses app in Python. According to the documentation it is recommended to use the wrapper as it auto initializes ...
2
votes
0
answers
74
views
How to set locale in ocaml?
I'm interested in changing LC_ALL in an ocaml program. The equivalent C function would be setlocale(LC_ALL, "my_new_locale");. How would one do this in ocaml?
2
votes
2
answers
75
views
windows not showing when the terminal is made smaller (ncurses, c)
I'm trying to make a program that has 2 windows side by side that scale to fit the terminal. However the windows only show when the terminal is made larger, not smaller.
I was wondering if it was a ...
0
votes
0
answers
21
views
How to use the pattern buffer of an ncurses menu?
The https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/menus.html website says that each menu has an associated pattern buffer which can be used to find the nearest match to characters entered.
But I ...
-1
votes
1
answer
41
views
Is there a hard limit for set_menu_format row or col arguments? Function is part of menu header file
I'm trying to write a menu-based ncurses program in C. I've already ensured that set_menu_format row argument is less than my sub_window size. However,I can't pass a number greater than 21 in the rows ...
0
votes
3
answers
272
views
Why curses.initscr() takes no effect in Windows 11 Command Prompt?
I´m trying to write some programs in Python with windows.curses but when I run the program nothing happens. The code is:
import curses
from curses import wrapper
def main(scr):
scr.initscr()
...
0
votes
1
answer
52
views
Prevent NCurses C++ Library From Creating Sub-Window
I want to prevent the C++ ncurses library from creating its own sub-window when activated. Whenever you use initscr() with ncurses, it creates its own sub-window (text area in terminal). Not using ...
0
votes
0
answers
58
views
Ruby thread.join does not return when using curses gem
I'm trying to get the ruby curses gem to run with multiple threads (on Windows) to run a serial port:
require 'serialport'
require 'curses'
include Curses
init_screen
start_color
curs_set(0)
noecho
$...
0
votes
2
answers
97
views
Python3 curses segfault on stdscr.refresh()
Here is a very small program that demonstrates the problem:
#!/usr/bin/env python3
import curses
import sys
import time
def main():
try:
stdscr = curses.initscr()
stdscr.clear()
...
0
votes
1
answer
125
views
How can I handle errors in OCaml when using ncurses?
I'm learning OCaml, and I want to write a curses application. I'm very new to this language, and as I started writing the curses functions, I noticed that many of them have the type unit -> err. I ...
0
votes
1
answer
79
views
Forking an interactive program from a curses process causes keyboard interference
From a curses interface, a user may fork a feh instance to view an image. The curses interface has hjkl navigation which should not be blocked as the image is viewed.
void display_file(void) {
...
0
votes
0
answers
44
views
Issues with moving map in curses in c
I am working on 2d terminal game like space invaders but with moving map. I have a issue where the map moves to the top and after reaching the top edge it changes characters of another wall coming ...
1
vote
1
answer
90
views
Getting 'Your terminal does not support color' error in Common Lisp cl-charms - How to enable color output?
I'm encountering an issue with the cl-charms library in Lisp. When compiling my code, I receive the error "Your terminal does not support color." Below is the code that reproduces the issue:
...
0
votes
1
answer
121
views
How to fill a full background color in Ncurses using derwin() subwindow function?
Is there a way to fill a full background color using derwin() subwindow function in Ncurses?
This is my program below. I am expecting all white background in the sonny subwindow but unfortunately not ...
0
votes
0
answers
110
views
ncurses - input/output on the same line
nocbreak();
echo();
mvwprintw(game->prompt, 1, 0, "Move from? ");
wgetnstr(game->prompt, input, 4);
wgetch(game->prompt);
/* find first not empty character and set cursor on it */
...
-1
votes
1
answer
291
views
How to detect the shortcut combination CTRL + Key in python curses
I have been reading the documentation on curses in Python but I cannot figure it out how to detect the combinations like CTRL-S, or CTRL-A, or ALT-X, or CMD+A (in macOS), etc.
Anyone knows how to do ...
0
votes
0
answers
59
views
Curses giving Segmentation Fault
I am just writing a simple stdscr.clear() statement and it is giving segmentation fault.
I even tried to try and except every statement but still it didn't work.
from __future__ import division
import ...
0
votes
0
answers
32
views
Have curses keep loading even while not focused?
I am trying to recreate this snippet of code:
from ctypes import windll
from os import system
from keyboard import is_pressed
main_window_handle = windll.user32.GetForegroundWindow()
...
0
votes
2
answers
98
views
Creating a windowed menu in ruby ncurses
I'm trying to learn ruby and ncurses a bit more by creating a small menu in ncurses which lists different interfaces and the interface configuration for the selected interface.
Since the ncurses ...
1
vote
0
answers
74
views
How to create a usable scroll with ncurses C
This basic program takes the contents of a file and displays it. Also with wsetscrreg() I have created a scroll section, all works perfectly, but the problem is that when I scroll and the text gets ...
-1
votes
1
answer
48
views
PyCurses MousClick
self.stdscr = stdscr
self.initialize(**object_dict)
self.map_all_colors()
self.draw_all_views()
curses.curs_set(0)
stdscr.keypad(1)
curses.mousemask(1)
curses.mousemask(curses.ALL_MOUSE_EVENTS)
# ...
1
vote
1
answer
86
views
Windows Curses Adding Weird Spacing [duplicate]
I have some python code that uses curses to continuously print "Test Bot." And allowing me to send messages at the same time now its printing "Test Bot." fine but when I try to ...
-1
votes
1
answer
53
views
How to use the curses module to display the colors calculated from the HSL model?
The code is based on three main components: hue, saturation and lightness. Hue represents the color itself, such as red, green, or blue, and is represented as an angle value between 0 and 360 degrees. ...
0
votes
1
answer
397
views
How to make a color gradient using RGB coordinates?
I'm trying to print a color gradient. When running, nothing is displayed, but when I select the entire window area with the mouse cursor, the colors appear but not a color gradient.
Function smooth ...
0
votes
1
answer
26
views
As, move the object per above and behind another object?
map Moon[MOON HEIGHT] object appears above const char *map World[MAP HEIGHT], because const char *map World[MAP HEIGHT] is printed before const char *mapMoon[MOON_HEIGHT].
The mapMoon object moves in ...
0
votes
1
answer
40
views
Blank column when offset reaches end of map
People, I have a matrix that moves from left to right and only the characters of the array that are inside the circle appear (distance = sqrt(pow((x - CENTER_X) / ASPECT_RATIO, 2) + pow(y - CENTER_Y, ...
0
votes
0
answers
76
views
Issue with Countdown Timer and User Input in Python using curses
I'm working on a Python program that involves a real-time countdown timer and allows the user to input a value inline with the timer using the curses library. However, I'm facing some issues with the ...
0
votes
1
answer
84
views
Input & Print at the same time?(python 3.11, windows11)
Currently, the code waits for user input before printing the next number. I want the code to print numbers continuously without being interrupted by user input, but still allow the user to enter a ...
0
votes
1
answer
334
views
Python Curses Rectangle Border
I am making a python program that makes heavy use of the curses.textpad.rectangle function. It draws a rectangle using ─┐│ characters. I would like to know if I could use any other characters as a ...
-2
votes
1
answer
28
views
Python curses import error: 'from curses import ACS_DARROW, ACS_LARROW, ACS_RARROW, ACS_UARROW' not working
File "C:\Users\a small youtuber idk\Downloads\from curses import ACS_RARROW.py", line 2, in <module>
from curses import ACS_DARROW, ACS_LARROW, ACS_RARROW, ACS_UARROW
i tried ...
0
votes
1
answer
239
views
Unable to use curses module in PyCharm [duplicate]
Unable to use the curses module in Pycharm even after successful installation of it in terminal. Also installed windows-curses package in Pycharm. import curses code is greyed out. When I run it in ...
-2
votes
1
answer
92
views
How can i find memory leaks in my program? [closed]
Im building a terminal-based file viewer project with ncurses.h and C.
Its only a side project as a hobby, and has a few lines of code.
I get some segmentation errors and I don’t even have a clue ...
0
votes
1
answer
63
views
Program with Perl's Term::Animation quits prematurely
When trying to move the object by pressing "d" or "a" perl quits.
I thought the problem was related to using the quit() function which was not defined. To fix this, I tried using ...
2
votes
2
answers
88
views
pdcurses installation has a type declaration error
I'm making a text-based game in C using the pdcurses library (version 3.4). I'm following a tutorial for the installation of pdcurses, and the tutorial uses version 3.4. If I download a newer version (...
0
votes
2
answers
244
views
Alternative for sleep in a zsh sub shell inner loop
I use zsh (zsh 5.9 (x86_64-apple-darwin22.0)) and zsh/curses for a small command line interface. The content of the view should automatically adjust when the window size changes. I tried a solution ...