VSCode: How to move the cursor in the REPL by clicking?

Hello, I am brand new to Julia and also the VSCode IDE. I noticed that when typing a line of code into the REPL, I can’t navigate the cursor by clicking with my mouse. I’m only able to do this with the left and right arrow keys. Is there a setting I can change that will allow me to use the mouse?

1 Like

Hi there,

As far as I know (at least in Linux), you cannot, in the REPL, use the mouse to move around at all. It does not matter whether, as seems to be your case, you are using VSCode’s built-in terminal, or if you are using the REPL in a pure console (outside VSCode). When in the REPL, I advise you to really get used to some key bindings or shortcuts, such as Ctrl-A or Ctrl-E; watch out, however, that these might depend on whether you are within VSCode or outside of it. For me it was really worthwhile learning some of these shortcuts!

4 Likes

As far as I know that is the case in all terminals on all operating systems. The only place I’ve seen that kind of behavior is the MATLAB command window. But you get used to it.

Tip: with CTRL+ or CTRL+ you can move across whole words, making everything much easier.

1 Like

This can be done! Alt+Click in the terminal lets you use the mouse to position the cursor.

2 Likes

But I agree, in the REPL and in UNIX terminals, I’ve always found this behavior to be frustrating, and I’ve never found any benefit to it or easy way around it.

Holding the arrow key and watching the cursor move over one character at a time always feels like that awkward fast walk that kids do after the lifeguard at the pool yells “no running!”

2 Likes

As well as the Home and End keys.