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

Recently added cursor shape customization pollutes some old(?) terminal output #540

Open
mguijarr opened this issue May 24, 2023 · 0 comments

Comments

@mguijarr
Copy link

Seen on Debian 8 with Gnome terminal:

$ ptpython
>>> [2 q

Commenting cursor= in Application constructor call fixes the problem:

def _create_application(
        self, input: Input | None, output: Output | None
    ) -> Application[str]:
        """
        Create an `Application` instance.
        """
        return Application(
            layout=self.ptpython_layout.layout,
            key_bindings=merge_key_bindings(
                [
                    load_python_bindings(self),
                    load_auto_suggest_bindings(),
                    load_sidebar_bindings(self),
                    load_confirm_exit_bindings(self),
                    ConditionalKeyBindings(
                        load_open_in_editor_bindings(),
                        Condition(lambda: self.enable_open_in_editor),
                    ),
                    # Extra key bindings should not be active when the sidebar is visible.
                    ConditionalKeyBindings(
                        self.extra_key_bindings,
                        Condition(lambda: not self.show_sidebar),
                    ),
                ]
            ),
            color_depth=lambda: self.color_depth,
            paste_mode=Condition(lambda: self.paste_mode),
            mouse_support=Condition(lambda: self.enable_mouse_support),
            style=DynamicStyle(lambda: self._current_style),
            style_transformation=self.style_transformation,
            include_default_pygments_style=False,
            reverse_vi_search_direction=True,
            #### COMMENTING THE NEXT LINES FIXES THE PROBLEM
            #cursor=DynamicCursorShapeConfig(
            #    lambda: self.all_cursor_shape_configs[self.cursor_shape_config]
            #),
            ####
            input=input,
            output=output,
        )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant