Julia: Up-arrow in REPL mode should only search/cycle that mode

Created on 13 Jun 2018  路  4Comments  路  Source: JuliaLang/julia

I think, when in a REPL mode the up-arrow should only cycle/search commands of that mode.

REPL

Most helpful comment

To argue this some more, two points:

If REPL modes are to be sticky, then there should be only few ways to exit them. Flicking back through history shouldn't be one of them, IMO. It certainly surprised me.

And as a second point, here a mock REPL session:

(v0.7) pkg> test MyPkg                                                                                                                                                   
...

(v0.7) pkg> ^C

julia>  a = 7                                                                                                                                                            
...

julia> t = 9                                                                                                                                                             
9                                                                                                                                                                        

...

(v0.7) pkg> # what should up-arrow now do?  Stay in Pkg-mode or go back to normal mode?

(v0.7) pkg> t # and now?

If I hit ] to enter package mode, then, when hitting up-arrow, I'm probably not interested to be dumped back to normal REPL mode. Instead I presumably would want to execute the last pkg-command.

An argument favoring the current behavior would be that when in normal mode and, say, I want to test a package again, then I could write test+up-arrow without first having to hit ].

(Note that I'd think that reverse serach (C-r) should indeed search through all modes as it does now)

Either way, we got a great REPL. Thanks!

All 4 comments

I think the current behavior is useful as-is, but I do understand your desire for such a feature. Perhaps it could be bound to a different key combination, retaining up arrow for its current use?

To argue this some more, two points:

If REPL modes are to be sticky, then there should be only few ways to exit them. Flicking back through history shouldn't be one of them, IMO. It certainly surprised me.

And as a second point, here a mock REPL session:

(v0.7) pkg> test MyPkg                                                                                                                                                   
...

(v0.7) pkg> ^C

julia>  a = 7                                                                                                                                                            
...

julia> t = 9                                                                                                                                                             
9                                                                                                                                                                        

...

(v0.7) pkg> # what should up-arrow now do?  Stay in Pkg-mode or go back to normal mode?

(v0.7) pkg> t # and now?

If I hit ] to enter package mode, then, when hitting up-arrow, I'm probably not interested to be dumped back to normal REPL mode. Instead I presumably would want to execute the last pkg-command.

An argument favoring the current behavior would be that when in normal mode and, say, I want to test a package again, then I could write test+up-arrow without first having to hit ].

(Note that I'd think that reverse serach (C-r) should indeed search through all modes as it does now)

Either way, we got a great REPL. Thanks!

I agree entirely with @mauro3: I frequently find it annoying that there is no way to "get me the last Pkg command"

Once you've typed ;, ? or ] I think it would fine to limit the search to those modes. That leaves no way to limit the search to the main mode but perhaps that's fine since that's naturally most inputs.

Was this page helpful?
0 / 5 - 0 ratings