Skip to content

Use ANSI based mouse processing and bracketed paste on Windows. #1961

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

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/prompt_toolkit/output/windows10.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ def responds_to_cpr(self) -> bool:
return False # We don't need this on Windows.

def __getattr__(self, name: str) -> Any:
# NOTE: Now that we use "virtual terminal input" on
# Windows, both input and output are done through
# ANSI escape sequences on Windows. This means, we
# should enable bracketed paste like on Linux, and
# enable mouse support by calling the vt100_output.
if name in (
"get_size",
"get_rows_below_cursor_position",
"enable_mouse_support",
"disable_mouse_support",
"scroll_buffer_to_prompt",
"get_win32_screen_buffer_info",
"enable_bracketed_paste",
"disable_bracketed_paste",
# "enable_mouse_support",
# "disable_mouse_support",
# "enable_bracketed_paste",
# "disable_bracketed_paste",
):
return getattr(self.win32_output, name)
else:
Expand Down
Loading