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

Windows: paste performance #5292

Open
brokedarius opened this issue Mar 1, 2024 · 4 comments
Open

Windows: paste performance #5292

brokedarius opened this issue Mar 1, 2024 · 4 comments

Comments

@brokedarius
Copy link

brokedarius commented Mar 1, 2024

xonfig

import datetime
from prompt_toolkit import prompt
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.keys import Keys

bindings = KeyBindings()

@bindings.add(Keys.Up)
def history_search_backward(event):
    event.current_buffer.history_backward()

@bindings.add(Keys.Down)
def history_search_forward(event):
    event.current_buffer.history_forward()

$PROMPT = '{INTENSE_GREEN}[{YELLOW}{user}{RESET}@{BLUE}{hostname}{RESET}:{cwd}─{INTENSE_YELLOW}[' + str(datetime.date.today()) + ']─{INTENSE_GREEN}[{localtime}]{INTENSE_RED}──>{RESET} '
$XONSH_HISTORY_BACKEND = 'sqlite'
$FORCE_POSIX_PATHS = True
$XONSH_SHOW_TRACEBACK = True
$INTENSIFY_COLORS_ON_WIN

Expected Behavior

When pasting text, it should take into account tab indents as well as spaces not only that but it should also do it much faster.

Current Behavior

When I paste functions and such, I have to wait several seconds/minutes for it to paste and only for it most of the time to not have it's tab indents/spaces taken into accounts. Kind of ironic for a python shell.

Steps to Reproduce

Copy pasting functions with tab indents or spaces as indents (spaces seem to have a bit less issues?)

@anki-code
Copy link
Member

I can't reproduce this. Please provide your xonfig as well as example.

@brokedarius
Copy link
Author

I can't reproduce this. Please provide your xonfig as well as example.

Seems to be only affecting functions with tab indents not spaces after further testing so apologies for lumping them in.

For instance can you please try pasting this small example function in a xonsh shell if you don't mind?:

def save_toml(toml_dict: dict[str, str], toml_path: str) -> None:

	with open(toml_path, 'w') as c:
		c.write(tomlkit.dumps(asdict(toml_dict)))

Also I am on windows, tried it on both tabby and windows terminal where its very slow to finish pasting, sometimes it does not when the function is a bit bigger. On conhost it pastes rather fast but the tab indents are not respected either.

@anki-code anki-code changed the title paste performance issues paste performance issues on windows Mar 1, 2024
@gforsyth
Copy link
Collaborator

gforsyth commented Mar 6, 2024

Can you confirm that pasting works as you expect when xonsh isn't in the mix?

@brokedarius
Copy link
Author

yes works fine from regular python console sorry I was away for a little while

@anki-code anki-code changed the title paste performance issues on windows Windows: paste performance May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants