Bug report
window.instr(), in_wstr() and in_wchstr() clamp the count to 2047, so a longer line is cut off with no indication. A pad can be wider than that.
import curses
def check(stdscr):
pad = curses.newpad(1, 3000)
pad.addstr(0, 2500, 'X')
return len(pad.instr(0, 0)), 'X' in pad.instr(0, 0).decode()
print(curses.wrapper(check)) # (2047, False), want (3000, True)
A window read is bounded by the window, so the count only needs to be capped by the columns left on the line, in the unit each method counts: cells for in_wchstr(), characters for in_wstr(), bytes for instr() -- at most CCHARW_MAX characters of MB_CUR_MAX bytes per cell.
The default could then mean the rest of the line, as n < 0 already does inside curses, instead of the arbitrary 2047.
getstr() and get_wstr() read the keyboard rather than the window, so their cap stays.
Linked PRs
Bug report
window.instr(),in_wstr()andin_wchstr()clamp the count to 2047, so a longer line is cut off with no indication. A pad can be wider than that.A window read is bounded by the window, so the count only needs to be capped by the columns left on the line, in the unit each method counts: cells for
in_wchstr(), characters forin_wstr(), bytes forinstr()-- at mostCCHARW_MAXcharacters ofMB_CUR_MAXbytes per cell.The default could then mean the rest of the line, as
n < 0already does inside curses, instead of the arbitrary 2047.getstr()andget_wstr()read the keyboard rather than the window, so their cap stays.Linked PRs