Skip to content

JLine 3: restore behavior: "You typed two blank lines. Starting a new command."? #12266

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

Closed
SethTisue opened this issue Mar 9, 2020 · 12 comments · Fixed by scala/scala#9407
Closed
Assignees
Milestone

Comments

@SethTisue
Copy link
Member

this no longer triggers, but there's less need for it now that we have multiline editing, so not a blocker ... I think?

@SethTisue SethTisue self-assigned this Mar 9, 2020
@SethTisue
Copy link
Member Author

but test/files/jvm/interpreter.check tests this behavior. why does the test pass, but it doesn't work interactively?

@SethTisue
Copy link
Member Author

ah, this has to do with @som-snytt's "Excise old continuation handling" todo in scala/scala-dev#689. the handling for this is in interpretStartingWith, which is no longer exercised interactively, since we now instead in ScalaParser#parse we have this logic:

        case ACCEPT_LINE =>
          if (repl.parseString(line) == Incomplete) throw new EOFError(0, 0, "incomplete")
          tokenize(line, cursor)     // Try a real "final" parse.

whereas interpreter.scala uses scala.tools.partest.ReplTest which apparently follows different code paths

@som-snytt
Copy link

The tests use a special testing entry point in ILoop module, with some code to handle special things like prompts and ctl-D. It's a useful but limited fake. Doti has no such facility at the moment.

@dwijnand
Copy link
Member

dwijnand commented Mar 9, 2020

If, for instance, you lose track of how many parentheses you should've closed, it's probably nice to keep the fact that two blank lines end the snippet and give you back a prompt so you can try again.

@som-snytt
Copy link

If I had to choose, I'd prefer ctl-C for get me outta here.

@SethTisue
Copy link
Member Author

the way I found to nope out is C-p to the top and then C-k til all the lines are killed, but perhaps there's a shorter nope-nope-nope sequence we have yet to identify

oh hey there @som-snytt, was wondering if you'd noped out of this whole business, you think you get weekends off do you?

@som-snytt
Copy link

@SethTisue we're all coronaed out here, and not the beer, so I've had no time for anything, sorry.

@SethTisue
Copy link
Member Author

SethTisue commented Mar 9, 2020

fortunately we're safe here in Switzerland, which...
<checks notes> um, borders northern Italy, hmm

@som-snytt
Copy link

Thanks for removing the prio:low labels. We need a label for expectations:low.

Everyone was out at the office, so instead of chatting, I was deleting partest flags files.

@SethTisue
Copy link
Member Author

SethTisue commented Mar 13, 2020

Thanks for removing the prio:low labels

I've now added a "help-wanted" label on many of these tickets instead, but I don't see a way to remove the stigma of "SethTisue added prio:low label" in the history, so these tickets will probably suffer from lingering self-esteem issues.

I will try to learn from this incident.

@pedroqueiroga
Copy link

pedroqueiroga commented Jun 5, 2020

Working for me: ctrl-G (like emacs)

I did press ctrl-SPACE though, and what I can't figure out is how to make it stop highlighting hehehe

@SethTisue
Copy link
Member Author

Working for me: ctrl-G (like emacs)

ah, nice, good to know! tends to leave junk on the screen, but perhaps that's JLine's fault rather than something in the Scala integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants