JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.69k stars 5.48k forks source link

shell mode: switch to pkg mode with ']' #42687

Open timholy opened 3 years ago

timholy commented 3 years ago

From julia> mode, ; switches to shell> and ] switches to pkg>. From pkg> mode, ; switches to shell> From shell> mode, ] does not switch into pkg>

It would be great to fix the last one.

KristofferC commented 3 years ago

As a note, it is Pkg that injects the keybinding for the Julia mode to switch to Pkg mode so presumably, it is also Pkg that should inject the keybinding for shell?

Chandu-4444 commented 3 years ago

Can I work on this? Please help me with few steps to get started.

KristofferC commented 3 years ago

Anyone can work on this. https://github.com/JuliaLang/Pkg.jl/blob/23008ab8e1d37b9ec7d6069c26cf4ffd2282afbb/src/REPLMode/REPLMode.jl#L591-L602 might be useful. Unless you are somewhat familiar with Julia, it might be a bit tricky.

Chandu-4444 commented 3 years ago

Anyone can work on this. https://github.com/JuliaLang/Pkg.jl/blob/23008ab8e1d37b9ec7d6069c26cf4ffd2282afbb/src/REPLMode/REPLMode.jl#L591-L602 might be useful. Unless you are somewhat familiar with Julia, it might be a bit tricky.

Wow, thanks for this. I'll try working on this.

RohitRathore1 commented 3 years ago

@KristofferC After implementing if I want to check it with Julia REPL that this feature is working correctly or not then how can I do this?

Chandu-4444 commented 3 years ago

@KristofferC After implementing if I want to check it with Julia REPL that this feature is working correctly or not then how can I do this?

I think you can use Revise

timholy commented 3 years ago

@Chandu-4444, do you have a pull request for this? I am guessing from discourse you already have this fixed?

Chandu-4444 commented 3 years ago

@Chandu-4444, do you have a pull request for this? I am guessing from discourse you already have this fixed?

I'm beginning to work on this after I figured out what went wrong with my setup.

memeyankm commented 3 years ago

I discovered Julia this hacktoberfest, and I want to contribute to this project. Please help me get started, thank you :)

albheim commented 3 years ago

We also have help?> mode which does not switch to either of pkg or shell mode (as well as the other way around).

Though I can see that this one might be problematic for special cases since we have that pkg> ? shows help in pkg mode, and not sure if anyone would ever want to start a bash command with a question mark but maybe that could also be a problem?

Is it not as easy and more consistent to just allow from repl to any mode, and backspace to go from any mode to repl?

inkydragon commented 2 years ago
                            ]      ┌────┐ ?
  help msg            ┌───────────►│pkg>├────► pkg mode help
     ▲                │            └─┬──┘
     │]               │              │
  ┌──┴───┐     ?   ┌──┴───┐          │ ;
  │help?>│◄────────┤julia>│          │
  └──┬───┘         └──┬───┘          │
     │;               │              ▼
     ▼                │     ;     ┌──────┐
  help msg            └──────────►│shell>│
                                  └──────┘

Drawing by https://asciiflow.com/

You can press backspace in any mode to return to REPL.

We may add:

ettersi commented 2 years ago

shell> + ? --> shell mode help

What would shell mode help be?

Chandu-4444 commented 2 years ago

shell> + ? --> shell mode help

What would shell mode help be?

Maybe man for shell commands?

ettersi commented 2 years ago

I'd say that's too opinionated, but that's just my two cents.

inkydragon commented 2 years ago

What would shell mode help be?

A few brief words about shell mode.

If possible, we can also add some platform-related notes For example: https://github.com/JuliaLang/julia/issues/23597

Hitansh-Shah commented 2 years ago

Hey, I would like to work on this issue. Can I work on this or someone else is already working?

Chandu-4444 commented 2 years ago

Hey, I would like to work on this issue. Can I work on this or someone else is already working?

I'm not working on it currently. You're good to go I guess.

Hitansh-Shah commented 2 years ago

I'm not working on it currently. You're good to go I guess.

Thanks for replying. I will try whatever I can do.

skleinbo commented 2 years ago

Hey, because there wasn't any discussion nor PRs in the last six months, I went ahead and started working on this. Hope I don't step on anyone's toes here.

Open question: how to handle (if at all) shell> ? The manual includes a note about non-POSIX shells by now. I suppose it wouldn't be too difficult to display an analogous message when a Windows user enters shell mode for the first time .