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

fix bracketed paste #577

Merged
merged 1 commit into from
May 2, 2023
Merged

Conversation

WindSoilder
Copy link
Contributor

Fixes: #576

Actually the issue comes from iterm2 setting when I want to paste multiline script:
img

But yeah, when we enable bracketed paste, we can avoid pasted script to be executed automatically, I think it's safe to transfer from \r to \n.

Currently I'm not sure how windows handle bracketed feature, since it doesn't work with crossterm lib, I'm going to convert from "\r\n" to "\n" to make sure that everything is working properly

@fdncred
Copy link
Collaborator

fdncred commented Apr 29, 2023

Where is that transforms dialog in iterm2?

@WindSoilder
Copy link
Contributor Author

It's auto popped up when I want to paste multiline content..
I guess it's enabled by Warnings config
图片

@fdncred
Copy link
Collaborator

fdncred commented Apr 29, 2023

ok, i see it now. thanks

@sholderbach
Copy link
Member

Are we good here with the result of the PR so we can enable bracketed paste on the nushell side if desired?

@fdncred
Copy link
Collaborator

fdncred commented Apr 29, 2023

@sholderbach it works on my mac just fine. I'm not on windows today so I can't test it there. Not sure about linux.

@WindSoilder
Copy link
Contributor Author

WindSoilder commented Apr 30, 2023

we can enable bracketed paste on the nushell side if desired?

After this pr, I think we can enable bracketed paste on mac/Linux, but still not on windows, it depends on crossterm issue

@fdncred
Copy link
Collaborator

fdncred commented Apr 30, 2023

it depends on crossterm issue

can't we check the platform and have a windows fix too? until crossterm decides to fix it?

@WindSoilder
Copy link
Contributor Author

Sorry I don't have a work around for this on windows, see the comment: #576 (comment)

It indicats that crossterm::Paste event doesn't work on windows.

Copy link
Collaborator

@fdncred fdncred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least on windows, it looks like it's pasting multi-line content fine. @sholderbach i'm fine with landing it.

@sholderbach sholderbach merged commit 65c4e7a into nushell:main May 2, 2023
@WindSoilder WindSoilder deleted the bracketed_paste branch May 3, 2023 07:16
sholderbach added a commit that referenced this pull request May 16, 2023
Includes a fix for bracketed paste mode (#577)
sholderbach added a commit to sholderbach/nushell that referenced this pull request May 16, 2023
This just includes the bracketed paste bugfix in nushell/reedline#577
sophiajt pushed a commit to nushell/nushell that referenced this pull request May 16, 2023
# Description
This just includes the bracketed paste bugfix in nushell/reedline#577


# User-Facing Changes
None

# Tests + Formatting

# After Submitting
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

Successfully merging this pull request may close these issues.

Bracketed Paste does not preserve newline characters in some terminal
3 participants