Allegedly good method to change the default shell in Cygwin doesn't work for me. Why?

-1

I'm trying to get Cygwin (CYGWIN_NT-6.1 / 2.11.1(0.329/5/3)) to start with tcsh as default shell on Windows 7. I read this question and answers there but had some issues with the mintty method mentioned in this particular answer:

If you start Cygwin with mintty, then add the shell as a parameter. mintty /usr/bin/zsh -

This is what happens:

  • using the trailing dash to invoke an interactive shell(?), makes a window flash and disappear again (whether or not I use -l)
  • mintty /bin/tcsh without the trailing dash or -l, a Cygwin shell window is opened, but many builtin commands result in "fatal error - cygwin base mismatch is detected...". I searched for and found an older version of cygwin1.dll (in ConEmu/wsl) as directed by the error message, renamed it, but to no avail - I keep getting the same error
  • mintty /bin/tcsh -l gives the best results, but starts with the home directory as Windows %USERPROFILE%. This means it also bypasses my .tcshrc in my cygwin home directory (<CygwinDir>/home/<account>), but strangely, does process .aliases from there. Also strangely, the point above (mintty without trailing dash or -l) starts in the correct cygwin home directory.
  • I also tried editing /etc/nsswitch.conf, as suggested by a different answer, but this made no difference.
  • Setting the Windows SHELL env var to /usr/bin/tcsh, as suggested by another answer to the referenced question, did work when launching from the desktop shortcut, but I don't think it's the "proper" way of doing it. When I run mintty from Windows command line, I get a failure message "Failed to run '/usr/bin/tcsh': No such file or directory".

Why doesn't the allegedly good answer work for me? Can anyone say how to do it correctly? Also, can anyone explain the mysteries of the trailing dash, fatal error, nsswitch or the SHELL var?

Neil

Posted 2018-09-19T11:15:10.177

Reputation: 11

Does /usr/bin/zsh exist ? – matzeri – 2018-09-19T12:34:02.467

@matzeri No, I haven't installed it. Using tcsh – Neil – 2018-09-19T12:39:53.443

There is chat. You need some more reputation to use it. See privileges, search for "chat" there.

– Kamil Maciorowski – 2018-09-19T12:46:41.383

Answers

0

To start the tc shell from mintty the command is:

mintty /bin/tcsh -l

To launch the default login shell, usually bash

mintty -

The format mintty /usr/bin/zsh - is wrong

matzeri

Posted 2018-09-19T11:15:10.177

Reputation: 1 662

Aha! This works well when assigned to a shortcut, but not from the DOS command line. I think this answer also belongs in the referenced question. Now it seems my question is actually about the method of running mintty - shortcut vs. command line, so should be completely rewritten? – Neil – 2018-09-19T13:59:56.083

it works also from CMD line. Have you run it from cygwin/bin ? – matzeri – 2018-09-19T14:40:01.600

Update: Yes, it does work from the command line, but started with home dir of Windows %USERPROFILE% (so bypassing ~/.tcshrc, but strangely executing ~/.aliases). After some fiddling I realized the problem was that I was launching from cmder (ConEmu+stuff), which had the HOME environment variable set, and mintty was adjusting to that. So all good now. I have to completely reword the question or perhaps it's completely obsolete – Neil – 2018-09-19T19:28:59.040