Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curses, can't write to loverright corner #34757

Closed
anonymous mannequin opened this issue Jul 15, 2001 · 3 comments
Closed

curses, can't write to loverright corner #34757

anonymous mannequin opened this issue Jul 15, 2001 · 3 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@anonymous
Copy link
Mannequin

anonymous mannequin commented Jul 15, 2001

BPO 441429
Nosy @akuchling

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/akuchling'
closed_at = <Date 2001-08-10.21:57:44.000>
created_at = <Date 2001-07-15.11:18:23.000>
labels = ['extension-modules']
title = "curses, can't write to loverright corner"
updated_at = <Date 2001-08-10.21:57:44.000>
user = 'https://bugs.python.org/anonymous'

bugs.python.org fields:

activity = <Date 2001-08-10.21:57:44.000>
actor = 'nobody'
assignee = 'akuchling'
closed = True
closed_date = None
closer = None
components = ['Extension Modules']
creation = <Date 2001-07-15.11:18:23.000>
creator = 'anonymous'
dependencies = []
files = []
hgrepos = []
issue_num = 441429
keywords = []
message_count = 3.0
messages = ['5412', '5413', '5414']
nosy_count = 2.0
nosy_names = ['nobody', 'akuchling']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue441429'
versions = []

@nobody
Copy link
Mannequin

nobody mannequin commented Jul 15, 2001

Whenever I try to write something to a window that
would cause text to appear in the lower right corner
I get an error
w = curses.newwin(2,10,0,0)
w.addstr(1,9,"X") ->
_curses.error: addstr() returned ERR

w.addch(1,9,ord("x")) ->
_curses.error: addch() returned ERR

Same behaviour on all versions I tried.
1.5.2
2.1
2.0

ncurses-5.2 if that is of importance.

@anonymous anonymous mannequin closed this as completed Jul 15, 2001
@anonymous anonymous mannequin assigned akuchling Jul 15, 2001
@anonymous anonymous mannequin added the extension-modules C modules in the Modules dir label Jul 15, 2001
@anonymous anonymous mannequin closed this as completed Jul 15, 2001
@anonymous anonymous mannequin assigned akuchling Jul 15, 2001
@anonymous anonymous mannequin added the extension-modules C modules in the Modules dir label Jul 15, 2001
@akuchling
Copy link
Member

Logged In: YES
user_id=11375

I believe this is a curses/ncurses limitation and not a
bug, though admittedly the limitation doesn't make much
sense for windows that don't touch the lower-right corner
of the terminal. You could try writing the analogous C
program and see if that also fails to work.

Making the window scrollable with w.scrollok(1) allows
this to work, at the cost of making the window scroll up
a line.

@nobody
Copy link
Mannequin

nobody mannequin commented Aug 10, 2001

Logged In: NO

Ok, I tried a little program in C.

#include <curses.h>

WINDOW *w;

int i,c,x1,x2,x3;
int main()
{
  initscr();cbreak();noecho();
  
  w = newwin(2,10,0,0);
  c = wgetch(w);
  x1 = mvwprintw(w,0,9,"Y"); /* IS OK */
  x2 = mvwprintw(w,1,9,"Y"); /* IS OK, BUT MIGHT REPORT
WRONG */
  x3 = mvwprintw(w,2,9,"Y"); /* THIS SHOULD NOT WORK */
  wrefresh(w);
  c = wgetch(w);
   
  echo();endwin();nocbreak();
  printf("RETURN VALUES: %d,%d,%d\n",x1,x2,x3);
  return 0;
}

When run, this program produces a screen with an Y on each
of the two first lines, just as expected.
It then ends and prints the output:

RETURN VALUES: 0,-1,-1

The first -1 should, as I see it, have been 0. I assume
the python code sees the -1 and raises the error?

So yes, this would seem to be an error in curses.

/Magnus.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir
Projects
None yet
Development

No branches or pull requests

1 participant