Closed ivarne closed 10 years ago
I thought about this quite a bit when I originally introduced those, and I came to the conclusion to not show them.
When I arrow up to older lines, the REPL does not remember the type of the command.
I know. This is intentional, but I don't feel particularly strongly about it. My original reason was the following: Say I type a command and I get the arguments wrong, so I want to look at the help. With this approach that's two keystrokes (?
up
), but maybe changing this and people using (up
^A
?
) instead would be better.
If the characters are shown, it is obvious that you can switch back to Julia mode by using bakcspace. Now I can not figure out how to switch back to Julia mode. For screenshots it would be better if the character pressed to switch mode stayed on the screen. Demonstrations would also be better, if everything show up on the screen.
These are fair points, but then again it's pretty easy to discover and I don't think there will be problems.
Yes, I know this is a question about taste, and does not cause important problems. We will see if others have opinions.
Hey!
Now going back to julia>
mode from shell>
and help>
with backspace works. That explains your rather short response to my (badly formulated) request to add the functionality. I am sure it did not work earlier today, but I have not updated since I tried so it is strange.
Hey! Now going back to julia> mode from shell> and help> with backspace works. That explains your rather short response to my (badly formulated) request to add the functionality. I am sure it did not work earlier today, but I have not updated since I tried so it is strange
Oh, for me that has always worked! Sorry, I missed that in your original post!
I think it would be helpful if esc
also broke you out of a submode. Keeping the mode when scrolling through history would be a better experience, IMO, but maybe hitting escape with text on the line changes modes?
esc
is tricky because it sends a literal \e
which is also the start of the escape sequences. Readline does it via timing, but I think just checking whether there are any more bytes in the buffer would work as well.
I'm guessing that either one would be fairly reliable, largely because esc
is so far in its own corner.
For what it's worth, I'm not sure why, but I find the psychological effect of the fact that the ;
and ?
don't show up and the prompt changes instead to be profound. I know it's a trivial difference, but somehow it makes typing commands into the repl feel almost as powerful as using a real shell. It's quite lovely. The semicolon was a good choice.
I agree on the estetics and the feel of it, but I still think that the commands are easier to learn when they are shown. For that issue a equally good solution might be just to change the prompt to ;shell>
and ?help>
.
@StefanKarpinski what do you think about the history remember type of command issue?
It absolutely must remember the command type. The fundamental premise of command history is that you can press the up key and hit return and do the same thing you just did again.
Honestly, I think it's completely fine for the REPL to just behave like there's an invisible semicolon/questionmark at the beginning of those lines. That implies that history remembers the command type and that the history file should actually contain the literal characters, even if they're not shown.
I do not like that you hide the
?
and;
characters when switching to help and shell mode.The first two concerns could be fixed without showing the characters though.