Shell mode causes issues on windows

Hi everybody, i just installed julia and i am still dealing with various settings,packages and errors.
i have recently learned about julia shell mode and I was trying some standard commands with cygwin and cmd. everything works up to the point where i want to quit the shell mode. The backspace shortcut doesn’t work and the only command that i can use to quit is exit which brings me to a corrupted julia terminal
image

how can i solve this issue? thank you

This thread may be of some use: Getting Julia REPL working in Windows git/bash

The workaround is to use the following script command on the REPL shell mode:

shell> cmd /C c:\\cygwin64\\bin\\bash -i -l

oheil@PC ~
$

I can only speculate: Julia is spawning commands directly using exec(), without any underlying terminal, not like e.g. running a remote command using ssh on linux/unix where the command is run with a shell (/bin/sh) as the execution part. This difference (missing terminal) is perhaps the cause for this weird behaviour above.

The workaround uses windows cmd to run the cygwin bash. Options -i -l are there to have have bash as a interactive login shell (e.g. to have typical commands like ls in your path).

1 Like

Hi,i have been using this trick for a while and it actually works well, but i was wondering if there is a way to implement a shortcut instead of writing the whole command. Can i set an alias in julia shell mode?

A file, e.g. cygwinbash.bat, somewhere in a folder which is in the PATH with

c:\\cygwin64\\bin\\bash -i -l

works well, except that the Julia window title is changed permanently to the bash prompt, which is in my case a ~.

Explicitly using cmd isn’t necessary here, because a .bat file is running in a cmd shell.

The change of the window title can be avoided by setting environment variable PS1 (and/or PS2,… not tested) to something without the escape sequences

\e]0;

or

\033]0;

For my cygwin PS1 is set in

c:\cygwin64\etc\bash.bashrc

and editing it there (removing above esc sequenced from the beginning of the PS1 string) solved this (minor) issue, too. Doing this, will prevent change of window title for all (interactive) cygwin bash windows. There are options to use a specific resource file or none at startup, but I stopped investigating further. These details are easily found in the man page of bash or on the web.

1 Like

This appears to be fixed in Julia 1.6.1

1 Like