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

bash allows pasting multi-line code snippets, but OSH/YSH don't #1994

Open
dezren39 opened this issue Jun 20, 2024 · 5 comments
Open

bash allows pasting multi-line code snippets, but OSH/YSH don't #1994

dezren39 opened this issue Jun 20, 2024 · 5 comments

Comments

@dezren39
Copy link
Contributor

i would like to be able to paste a multiline example and it works right

f() {
  local -n out=$1    # -n for named reference
  out=bar
}

x=foo
f x
echo x=$x 

bash

[user@nixos:~]$ f() {
  local -n out=$1    # -n for named reference
  out=bar
}

x=foo
f x
echo x=$x
x=bar

ysh

ysh ysh-0.22.0$ f() {^J  local -n out=$1   # -n for named reference^J  out=bar^J}^J^Jx=foo^Jf x^Jecho x=$x^Jx=bar

osh

osh-0.22.0$ f() {^J  local -n out=$1    # -n for named reference^J  out=bar^J}^J^Jx=foo^Jf x^Jecho x=$x ^J

i realize this specific example is like, a bash script i passed into ysh and osh, but same thing happens if it was valid i think.

@dezren39
Copy link
Contributor Author

related but separate technically, is there a toggle hat would turn off the automatic scrolling when long lines are pasted? i'd rather it wrap

@andychu
Copy link
Contributor

andychu commented Jun 22, 2024

Hmm I think this is also a GNU readline thing we don't control

But it has a lot of settings, so not sure if this could be addressed

I think this is the same as bash right? what about zsh or other shells?

@dezren39
Copy link
Contributor Author

Top example bash pasted the whole thing and wraps, I'll try and check zsh and some others soon

@andychu andychu changed the title allow multiline pastes bash allows pasting multi-line code snippets, but OSH/YSH don't Jun 24, 2024
@andychu
Copy link
Contributor

andychu commented Feb 2, 2025

Hmm this is another related thing we should check with OILS_COMP_UI=minimal, which @melvinw is working on

That was for

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

2 participants