Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Setting Shell = Cygwin makes Console unusable

2012-08-09
2013-06-12
  • Evan Phelan
    Evan Phelan
    2012-08-09

    I was looking to use Cywgin from within Console2 so I did the following:

    1) Opened a new Console2 instance
    2) Set Shell to C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico - (this is the path taken from my Cygwin shortcut)

    This worked perfect, the Console tab now behaved as a cygwin terminal.

    Howver, when I opened a new tab, a new Cygwin terminal opened (as in the Cygwin application itself), as well as an instance of Console2. The instance of Console2 is unusable - it appears just as the border of the application, with only the mimimize, maximise and close buttons. Also, when I start a new Console2 now, the same problem occurs.

    How do I (i) get Console2 working again (in non-Cygwin mode) and (ii) get Cygwin working properly?

    All suggestions much appreciated. Thanks

     
  • Ronald
    Ronald
    2012-08-09

    I don't think you can make mintty working within Console2. After all, mintty is supposed to manage its own Window.

    My method to set up a Cygwin Shell in Console2 is like this:

      cmd /c c:\cygwin\bin\zsh -l

    (or whatever shell you prefer). However, terminal control doesn't exactly behave like in mintty, so you have to try it out to see whether you like it.

     
  • Evan Phelan
    Evan Phelan
    2012-08-09

    Thanks, your suggestion has given me capabilities to run UNIX commands.

    However, something like a grep over a folder hierarchy (a command I use a lot):

    grep -rin 'blah' */*

    … does not work in Console2:

    grep: */*: Invalid argument

    … even though it does work fine when I run bash from the standard command window. If this does not work, I'm concerned what other limitations there are? Indeed, is there a way around this?

    Thanks

     
  • Evan Phelan
    Evan Phelan
    2012-08-09

    In addition:

    - My Cygwin aliases are not recognized
    - Now, having tried the cmd /c c:\cygwin\bin\zsh -l approach, I am unable to start a new instance of Console2 (I click on it in my Start menu and nothing happens).

    Any suggestions?

     
  • Ronald
    Ronald
    2012-08-09

    About your posting number 3:  How did you set up your *bash* tab? Are you sure that bash was loaded?

    About your posting number 4: Did you correctly install zsh? Does it work if you start it from a normal Windows command window?

    And in general: Did you do your modifications in your main (i.e. default) tab, or in additional tabs? I always put these things into *new* tabs in Console2, and leave the first (default) tab unchanged. Doing so, does not cause problems if I happen to set up a command which doesn't work.

     
  • Evan Phelan
    Evan Phelan
    2012-08-09

    Thanks for the quick reply rovf. See answers inline.

    About your posting number 3: How did you set up your *bash* tab? Are you sure that bash was loaded?
    I don't have zsh so I used cmd /c c:\cygwin\bin\bash -l. Bash is present and correct.

    About your posting number 4: Did you correctly install zsh?
    Does it work if you start it from a normal Windows command window?
    Sorry I meant cmd /c c:\cygwin\bin\bash -l

    And in general: Did you do your modifications in your main (i.e. default) tab, or in additional tabs? I always put these things into *new* tabs in Console2, and leave the first (default) tab unchanged. Doing so, does not cause problems if I happen to set up a command which doesn't work.
    I left the other tabs as they were (default Windows behaviour), opened a new tab and made the Shell setting in there

     
  • Ronald
    Ronald
    2012-08-09

    As for bash, I usually specify "-i" too (to ensure that it's regarded an interactive shell). However, I don't think that this really matters in your case.

    More strange is the fact that you did NOT modify the primary tab, but Console2 doesn't start anymore. This certainly should not happen. Maybe a corrupted XML file? I would first try to start Console2 from the command line, to see whether there are error messages which might hidden when starting it from the Desktop. Then, I would inspect the XML file for the console configuration (ideally using an editor which does syntax colouring), to verify that it is well-formed.

     
  • Evan Phelan
    Evan Phelan
    2012-08-09

    Started it from the command line, same result (it doesn't start, no error messages). The configuration file is well-formed (although I can it see it has a last-modified timestamp of earlier today.). Is it worthwhile me sending it to you?

    Now, clicing on File-New Tab does not do anything.

     
  • Ronald
    Ronald
    2012-08-10

    Not being the developer of Console2, I fear I won't see logical errors in the XML file, but if you find a way to upload it somewhere and post the link, maybe someone with more knowledge on the matter could have a look.

    Next I would try is to re-install the original XML file (to test whether the problem is in the XML file, or somewhere else). Of course you should backup your current one.

    One more idea: Did you ever - during your changes in the settings - check the box "save settings to the user directory"? If this were the case, it could mean that Console2 is using a different XML file than you think it does.

    BTW - When starting Console2, you can always use the -c option to explicitly specify, which XML file to use.

     
  • Evan Phelan
    Evan Phelan
    2012-08-13

    So i've reinstalled Console2, and have diffed the XML of the new install against that of my install that started to misbehave.

    The only diff I can see is(ldiffs in bold)

    <console change_refresh="10" refresh="100" rows="25" columns="80" buffer_rows="9999" buffer_columns="0" shell="cmd /c c:\cyg" iwin\bin\zsh -lnit_dir="" start_hidden="0" save_size="0">

    There are two other diff but they relate to the cosmetics of Console2 so I imagine they are irrelevant to this problem.

    I wasn't checking the save settings to the user directory" box when making those changes for Cygqin.

    So at this point with the new install, Cygwin is working as expected, apart from the (i) my cygwin aliases not being recognized and (ii) it does not like when I attempt to grep over */*. The latter works fine in Cygwin itself.

    I've tried both of the above using an application similar to Console2, and they are a problem there too, so perhaps this is not somehting that can be solved. I can underrtsand why Console2 or similar program might not be aware of my Cygwin aliases, bu tthe grep issue is very odd indeed.

     
  • Alan
    Alan
    2012-08-17

    I had the same issue are you. I used the path in the cygwin shortcut and added it the the console bash prompt. I have recently got this to work now with cygwin. Instead of using the shortcut path with seems to call the minty.exe file, i used the c:/cygwin/Cygwin.bat file. It now works fine inside of console.

     
  • Ronald
    Ronald
    2012-08-17

    ephelan: Unless you made a copy-and-paste error when posting, or maybe the formatter for the postings in this forum messed up something, your XML <console> element  indeed doesn't look very healthy, in particular with respect to spacing and quotes.

    Here is the entry from my console.xml:

    <console shell="cmd /c C:\cygwin\bin\zsh -l" init_dir="" run_as_user="0" user=""/>

     
  • Ronald
    Ronald
    2012-08-17

    Here also my entry for a bash login shell:

    <console shell="C:\cygwin\bin\bash.exe -login -i" init_dir="c:\" run_as_user="0" user=""/>

     
  • Kirill
    Kirill
    2012-10-21

    Evan, sorry to be late to the party, but here you are.

    Most likely problem with missing aliases and non-working grep is differences in environment. First thing I would do is to compare the output of "set" from two instances of bash (one from cmd and one from Console). Maybe something like HOME or TERM is missing (most likely that how Alan got it working by using the shortcut).

    Second, is mintty a GUI app that looks like a terminal (similar to PuTTY)? If so, don't try to use it as a shell in Console.

    Thirdly, I vaguely remember being surprised by non-working "bash -i -login" while "bash -login -i" works.

    I use bash from msysGit - the Shell field is c:\path\to\bash.exe -login -i - and everything seems to work fine, including stuff from my bash profile and grep */*

    • Kirill