TheUsualAlex Posted December 1, 2003 Share Posted December 1, 2003 Hi, Does anyone here know how to get tcsh to launch by default with all the shell functionality in tact? When I set the tcsh to be the default launch in the cygwin.bat file, I can't even do things like "ls" and such. Only when I launch bash by default first and invoke the tcsh shell -- then that'd work. I guess I just like to launch tcsh by default first on the fly instead of typing tcsh and 2 exits afterwards... Thanks. Alex Quote Link to comment Share on other sites More sharing options...
edward Posted December 2, 2003 Share Posted December 2, 2003 Here's how I setup a unix environment on Windows. 1. Download cygwin from http://www.cygwin.com I can't remember what packages I downloaded but the default ones should be good. Install it to c:/cygwin 2. Create the c:/bin directory. Copy the csh.exe from your latest Houdini distribution and put it into c:/bin. 3. Now set up a HOME environment variable to point to your home directory (eg. c:/home). 4. Inside $HOME, create a .login file. In the first lines, do something like this: setenv PATH '.;'$HOME'/bin;c:/bin;c:/cygwin/bin;'$PATH On my home system, I use the Windows version of vim and gvim (download from http://www.vim.org) which I install to c:/Vim. Which means my .login has: setenv PATH '.;'$HOME'/bin;c:/Vim/vim61;c:/bin;c:/cygwin/bin;'$PATH setenv EDITOR vim.exe setenv VISUAL gvim.exe 5. Copy a shortcut from c:/bin/csh.exe to your desktop (and/or quicklaunch bar). Right-click on the new shortcut and choose Properties... In the Target name add the -l option after csh.exe. This tells csh.exe to source your .login file when it starts. 6. To launch, click on shortcut. After this, you can further modify your .login file. A good start is to launch this csh and then do "printrc >> .login" which gives you a nice starting point. I generally comment out the lines "set correct=all" and "set autocorrect" as I find those features annoying. I dislike having my aliases stored in my .login file so I extracted those lines at the end out and put it into a separate file and use "source ~/.alias" instead. Here's what I currently have in my ~/.alias file at home: alias ls ls-F alias l ls-F alias ll ls-F -l alias h history alias rm rm -i alias rd rmdir alias md mkdir alias mv mv -i alias cp cp -i alias pwd 'echo $cwd' alias env printenv alias unsave unset savehist savedirs alias ali 'gvim ~/.alias; source ~/.alias' Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted December 4, 2003 Author Share Posted December 4, 2003 Hi Edward, Thanks so much for your info. Unfortunately, I am still unable to do it. I guess that's quite all right. I can just get by when what I have now. Cheers, Alex Quote Link to comment Share on other sites More sharing options...
edward Posted December 5, 2003 Share Posted December 5, 2003 What's the problem? Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted December 7, 2003 Author Share Posted December 7, 2003 Hi Edward, Well, in the cygwin.bat file, I specify it to launch tcsh by default (rem-ed the line on bash). tcsh launched just fine. But, default command such as ls, grep, pwd, etc. will not work. It's just a command not found. The strange thing is that it's fine if I launch bash shell first, and lauch tcsh from within bash shell. Not sure how to fix this, but I guess I'll just deal with bash-tcsh instead. Thanks, Edward. Alex Quote Link to comment Share on other sites More sharing options...
edward Posted December 7, 2003 Share Posted December 7, 2003 That's because your path is not set up correctly. Notice how in my instructions I said to install cygwin into c:/cygwin which then my in .login script, I add c:/cygwin/bin to the PATH environment variable. Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted December 19, 2003 Author Share Posted December 19, 2003 Hi Edward, I finally got it to work last night. What I didn't do in the past was that I forgot to specify "tcsh -l" in the cygwin.bat file, hence the ls stuff wouldn't even work. Now everything worked. I guess emulation still has no match for the real UNIX environment still. But, I am happy. Thanks, Edward! Quote Link to comment Share on other sites More sharing options...
edward Posted December 19, 2003 Share Posted December 19, 2003 Ah I see. You forgot step 5. Happy shell-scripting on Windows land! (and holidays too Quote Link to comment Share on other sites More sharing options...
MG Posted October 19, 2005 Share Posted October 19, 2005 I use tcsh as well and everything works fine for me. I don't even really remember how I set things up, it's been a while. I did back-up all the configuration files, but I don't remember what I changed originally. To think of it: The Cygwin toolset is one of the few things that makes Windows still, quite, worthwhile. I wonder if Microsoft realizes this, amidst all the 'new' and 'modern' (read: useless) features for each and - more hardware-demanding - release of Windows... Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 16, 2008 Share Posted October 16, 2008 hey guys, gonna revive the thread from 2005 a little i set up everything like edward described, and it works fine so far, but i'm having a problem with external editors.. i'm trying to use crimson editor(some windows editor) which apparently doesn't understand the unixy path houdini sends from the .tmp.str file it creates. everything works fine with gvim but crimson complains about an invalid path which looks something like 'C:\bin\C:\Users\Aearon\AppData\Local\Temp\hfsblabla.tmp.str' while in gvim it shows up correctly as '~\AppData\Local\Temp\hfsblabla.tmp.str' and opens the file just fine where the C:\bin at the start of the path is wherever y run houdini from in the shell is there maybe some way to change the string houdini sends to the editor or anything i can change in my shell setup? Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 16, 2008 Share Posted October 16, 2008 and another beginner question: running csh.exe like this, how do you get key bindings as with cygwin? e.g. for the arrow keys (char back, char forward, up-history) things like bindkey <ctrl-v>HOME beginning-of-line on the shell don't seem to have any effect? same for anything i tried in .login Quote Link to comment Share on other sites More sharing options...
edward Posted October 16, 2008 Share Posted October 16, 2008 Here's the .loginbindkeys file that I source from .login #Bind keys for tcsh # Set vi bindings for keys #bindkey -v bindkey -b ^W backward-delete-word bindkey -b ^U backward-kill-line bindkey -b ^R complete-word-fwd bindkey -b M-g list-glob bindkey -b M-* expand-glob bindkey -b M-v expand-variables bindkey -b M-w normalize-command bindkey -b M-/ which-command bindkey -b N-up up-history bindkey -b N-down down-history bindkey -b N-right forward-char bindkey -b N-left backward-char bindkey -b N-del delete-char bindkey -b N-ins overwrite-mode bindkey -b N-1 which-command bindkey -b N-2 expand-history bindkey -b N-3 complete-word-raw bindkey -b N-home beginning-of-line bindkey -b N-end end-of-line Quote Link to comment Share on other sites More sharing options...
edward Posted October 16, 2008 Share Posted October 16, 2008 PS. bindkey does work. Note though that since it's sourced from .login, you have to run "csh -l" when starting the shell to have it read. Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 16, 2008 Share Posted October 16, 2008 cool thanks, that works now! Quote Link to comment Share on other sites More sharing options...
Aearon Posted October 17, 2008 Share Posted October 17, 2008 hey edward, so your second reply just now. actually i didn't know about the -b flag so that was what went wrong. thanks! Quote Link to comment Share on other sites More sharing options...
Ishmael Posted March 27, 2009 Share Posted March 27, 2009 I'm afraid I'm having some trouble getting my keybindings to work. When I run them from the command line, they work fine, but when I put them in one of my dot files, they don't work. Here's what I've got in a file I created (called .tcshkeybindings) that I source from my .tcshrc file: echo "Running .tcshkeybindings" bindkey "^[[b" "history-search-forward" bindkey "^[[A" "history-search-backward" This allows me to auto-complete a command by typing a few characters, then hitting the up-arrow - an extremely convenient feature of the tcsh shell. I've tried adding a line in there like you suggested bindkey -b N-up up-history but then I get the following error: Bad key spec N-up Any ideas how to fix this? Thanks a lot! Here's the .loginbindkeys file that I source from .login #Bind keys for tcsh # Set vi bindings for keys #bindkey -v bindkey -b ^W backward-delete-word bindkey -b ^U backward-kill-line bindkey -b ^R complete-word-fwd bindkey -b M-g list-glob bindkey -b M-* expand-glob bindkey -b M-v expand-variables bindkey -b M-w normalize-command bindkey -b M-/ which-command bindkey -b N-up up-history bindkey -b N-down down-history bindkey -b N-right forward-char bindkey -b N-left backward-char bindkey -b N-del delete-char bindkey -b N-ins overwrite-mode bindkey -b N-1 which-command bindkey -b N-2 expand-history bindkey -b N-3 complete-word-raw bindkey -b N-home beginning-of-line bindkey -b N-end end-of-line Quote Link to comment Share on other sites More sharing options...
edward Posted March 27, 2009 Share Posted March 27, 2009 Not sure. Personally, I've switched over to bash for a while now. You might want to ask on the tcsh.org mailing list. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.