Cygwin and TCmd 9

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
Wonder if there are any tips on using Cygwin with TCmd v9.02.

I want to start TCmd with 2 tabs, TCC and Cygwin. So I defined an additional tab for "Cygwin" via Options > Configure Take Command > Tabs. But every time I start TCmd, the Cygwin instance is always is detached from the Tab Window as a separate floating window of its own, and I have to manually click on Tabs > Attach Tab to bring it back. I have tried setting the tabs manually and exiting TCmd, but when I restart TCmd again, the Cygwin window is always detached.

I also notice that although I named the Tab "Cygwin", the new tab instance is renamed "~", which I recognize is the shell symbol for one's home directory.

My settings for the Cygwin tab are simple: Title: "Cygwin", Command: "c:\cygwin\cygwin.bat". COMSPEC, Directory, and other fields are empty. And if it means anything, I'm using Windows XP, not Vista. TIA.
 
Jun 2, 2008
42
0
#2
Wonder if there are any tips on using Cygwin with TCmd v9.02.

I want to start TCmd with 2 tabs, TCC and Cygwin. So I defined an additional tab for "Cygwin" via Options > Configure Take Command > Tabs. But every time I start TCmd, the Cygwin instance is always is detached from the Tab Window as a separate floating window of its own, and I have to manually click on Tabs > Attach Tab to bring it back. I have tried setting the tabs manually and exiting TCmd, but when I restart TCmd again, the Cygwin window is always detached.

I also notice that although I named the Tab "Cygwin", the new tab instance is renamed "~", which I recognize is the shell symbol for one's home directory.

My settings for the Cygwin tab are simple: Title: "Cygwin", Command: "c:\cygwin\cygwin.bat". COMSPEC, Directory, and other fields are empty. And if it means anything, I'm using Windows XP, not Vista. TIA.

My first recommendation would be: Don't use CygWin.bat!

CygWin.bat contains:
Code:
@echo off
 
C:
chdir C:\CygWin\bin
 
bash --login -i
If you set a startup directory of C:\CygWin\bin and a command of C:\CygWin\bin\bash.exe --login -i then you don't need the batch file.

Besides, running the batch file involves the overhead of starting a cmd.exe or tcc.exe wrapper to start bash, which is completely unnecessary. In fact, this may be why it's not starting up in a tab but detached.

Of course, you can switch bash out for any of the cygwin shells.

A word of caution: CygWin/Unix utilities such as screen and ssh can cause display corruption inside a Take Command tab if there are multiple levels of shell invocations. For example, running bash > ssh > bash > screen > bash will cause display corruption. Or did, Rex may have fixed that and I haven't tried recently. Detaching the tab shows that the console remains unaffected.


- Josh
 
#4
pitonyak wrote:
| ---Quote---
| @echo off
| C:
| chdir C:\cygwin\bin
| bash --login -i
| ---End Quote---
| If I run this, it starts a cygwin session inside of my tcc window
| with no problems.

You can shorten the above to:

@cdd C:\cygwin\bin
@bash --login -i

We have CDD - cygwin cannot depend on it. There is no reason to use a
separate @ECHO OFF command for just 2 (or just a few) commands. You can even
set a TCC option to make it the default for all batch files.

The above will start BASH in either a TCC window, on in a TCMD tab. However,
the tab will still have TCC as a primary.

To start bash in a TCMD tab when TCMD starts, use Josh' suggestion: setthe
following, using the TCMD OPTION:
start directory: C:\cygwin\bin
command: C:\cygwin\bin\bash --login -i

BTW, you cannot run "cygwin" - it is a colletcion of programs, none of which
is named cygwin. You can run any of those programs. Some of the programs are
command processors (which *nix people don't consider to be real programs,
only to be wrappers around the OS, so they use a term describing the outer
part of nuts).
--
Steve
 
#5
If you set a startup directory of C:\CygWin\bin and a command of C:\CygWin\bin\bash.exe --login -i then you don't need the batch file.
Thanks, this was the information that I needed. I did as you suggested (and Pitonyak and Steve F.), and everything seems to work now. The tab is properly attached, which was my main annoyance.

Of course, you can switch bash out for any of the cygwin shells.

A word of caution: CygWin/Unix utilities such as screen and ssh can cause display corruption inside a Take Command tab if there are multiple levels of shell invocations.
Have you tried switching to ksh or pdksh from bash? My highlighting is corrupted. Is this just me, or is it a problem with the pdksh configuration in /etc/profile, or is it a TCmd-Cygwin incompatibility?

In the past, I have also had prompt and highlighting issues when trying to use PLINK (part of the PuTTY package) from within Cygwin.

I appreciate the help from other Cygwin users here ...

Eric
 
Jul 25, 2008
3
0
#7
I use bash directly instead of cygwin. My tab configuration is as follows:

Title: Bash
Command: C:\Cygwin\bin\bash.exe --login
Directory: C:\Users\[myhome]

Note that I am using Vista, but this also worked in XP before I downgraded. I also created a link from C:\Cygwin\home\[myhome] to C:\Users\[myhome] so that my Windoze and Cygwin homes are the same.

BTW, I wish my job allowed me to run Linux :-).