Skip to content

Commit

Permalink
feat: implement acurses curs_set
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Apr 18, 2024
1 parent d458a55 commit 0d9b762
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/acurses.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,14 @@ def use_default_colors() -> None:


def curs_set(visibility: int) -> None:
"""Set the cursor state. Not yet implemented."""
_ = visibility
"""Set the cursor state. 0 for invisible, 1 for normal"""
if visibility == 0:
stdout.write("\033[?25l")
elif visibility == 1:
stdout.write("\033[?25h")
else:
raise NotImplementedError("Invalid visibility level")
stdout.flush()


window = _CursesWindow # pylint: disable=invalid-name
Expand Down Expand Up @@ -266,7 +272,7 @@ def wrapper(func: Callable[..., _T], /, *args: list[Any], **kwds: dict[str, Any]
try:
if not IS_WINDOWS:
setcbreak(fd) # type: ignore
stdout.write("\033[s\033[2J\033[H\033[?25l")
stdout.write("\033[s\033[2J\033[H")
stdout.flush()
stdscr = initscr()
# _curses.start_color()
Expand Down

0 comments on commit 0d9b762

Please sign in to comment.