I find that in the REPL I start by cd(“directory where the data is”) constantly, and this irritates me. By that I mean repeated cd() calls till I get to the directory with the correct data file.
Yes, I know I could set a filepath variable and use that joined tot the filename.
My suggestion is to have a quick and dirty GUI utility which would pop up and change the current working directory. Written in Julia, natch.
I think a Julia curses utility was recently announced. Perhaps perfect for this task.
Note to self - get your backside in gear and write it.
My opinion is that if you constantly do cd() in the REPL (or even in scripts), you are doing something “wrong”. I am even more confused since you are asking for a GUI, which makes it even slower and more sluggish to change a directory (waiting for the GUI to pop up, orientate, grab the mouse, clicking, closing etc.).
Besides that, integrating a GUI functionality into the REPL would be a significant amount of work, considering that people are running the REPL on macOS, Windows, Linux, *BSD and even in arbitrary Terminals like Jupyter Notebook/LAB. There is no common library which would unite all of them so you will definitely end up with all sorts of GUIs and dependencies needed.
And I just tried and found out, in the REPL:
cd("<TAB>
works also quite well.
Pressing TAB gives you all folders available in the current working dir. (Windows here)
function changefolder()
!Sys.isapple() && exit()
command = """
try
set af to (choose folder with prompt "Folder?")
set result to POSIX path of af
on error
beep
set result to "$(pwd())"
end
result
"""
cd(chomp(read(`osascript -e $command`, String)))
println(pwd())
end
changefolder()
julia-repl has a function julia-repl-cd (bound to C-c C-p by default) that sends a cd command to the REPL with the directory of the file that belongs to the buffer. I use this for small projects.
But if you are doing this regularly, consider defining something like
in the project you are working on, so that you can write pathnames independent of the current directory in a convenient way. Or even just cd(project_path()).