![]() |
|
![]() | ||
|
Subject:
Using home key in tcsh
Category: Computers Asked by: jalanb-ga List Price: $15.00 |
Posted:
14 Jun 2002 19:18 PDT
Expires: 21 Jun 2002 19:18 PDT Question ID: 27006 |
How do I use the Home Key to move to the start of the command line ? I use a Dell Inspiron PC, which is connected via Hummingbird's Exceed to a Solaris server. I log in through an xterm window running tcsh as my shell. I want to use <Home> and <End> as "goto start of line" and "goto end of line" respectively on the command line. While we're on the subject it's be nice to find out how to set up the F1, F2, F3 ... keys for specific operations too. And how do I get it all to work from the PC ? So that I don't have to make changes on every server I log in to ? |
![]() | ||
|
Subject:
Re: Using home key in tcsh
Answered By: webadept-ga on 14 Jun 2002 23:51 PDT Rated: ![]() |
Hi, First make a backup copy of your ~/.cshrc file. like this : cp .cshrc cshrc.back Using Vi (or whatever editor you have available) Put the following lines in your personal ~/.cshrc file: #.cshrc if ($term == "xterm" || $term == "vt100" \ || $term == "vt102" || $term !~ "con*") then # bind keypad keys for console, vt100, vt102, xterm bindkey "\e[1~" beginning-of-line # Home bindkey "\e[7~" beginning-of-line # Home rxvt bindkey "\e[2~" overwrite-mode # Ins bindkey "\e[3~" delete-char # Delete bindkey "\e[4~" end-of-line # End bindkey "\e[8~" end-of-line # End rxvt endif This should give your keys the right mapping, or at least the mapping you are looking for. You can bind keys, such as the F1 key to anything you like. I recommend getting a book on tcsh, to see what else is available for mapping commands. The nice thing is most servers are setup so that you can change your personal settings without affecting anyone else. You won't have to make changes every time you log in. Once the changes are made to the resource file, they are made. That's it. You can edit the resource file anytime you like, and then those changes are complete. Nothing needs to be done on your PC. A tip at this point : I would suggest strongly getting a hold of your System Admin and asking him to help you with these changes. He may know a better way, or be able to guide you through the process. If you are not fimiler with editing resource files, I strongly suggest you do this. Thanks for the question, and be sure to make the backup copy before you get started. webadept-ga | |
| |
|
jalanb-ga
rated this answer:![]() That's enough for me - in particular the page from Keele proved very helpful in not only my "Home" problem, but general setup of my Exceed config. Thanks |
![]() | ||
|
Subject:
Re: Using home key in tcsh
From: 1e100ga-ga on 16 Jun 2002 13:39 PDT |
tcsh will not read the .cshrc file if you have a .tcshrc file. In that case the commands need to go in the .tcshrc file. You should be able to make the home key go to the start of the line on the server level by typing: bindkey ctrl-v<press your home key> beginning-of-line Note that when you press ctrl-v nothing should display on your screen, it just tells the server to insert the next character literally instead of trying to interpret it. The command line should look something like bindkey ^[[1~ beginning-of-line You can do the same thing to map the end key to end-of-line In order to get this to work from your PC, you need to first find out how those functions are mapped on the server. Typically beginning-of-line is mapped to "^A" which means ctrl-A, and end-of-line is mapped to "^E" which means ctrl-E. You can verify this by typing 'bindkey' by itself or 'bindkey |grep beginning' and looking for the appropriate line. Then you can go to the Exceed input editor and set the home key to ctrl-A and so on. You may be able to do this as a key mapping, but to me it looks like this will need to be done as a macro. To set it up as a macro, go into the Xconfig window and then Input. Click on Edit/Macros.../Add.../Start Record, and press ctrl-A. It will probably be displayed as "+[ctrl][a]-[ctrl]". Click on Stop Record, and then select the Home key in the bind list (hopefully it is in there), and click OK. Save the keyboard file by going to File/Save As. There is an example of this at http://wwwinfo.cern.ch/ce/ae/Saber/exceed/exceed.html For more information on bindkey you can go to http://www.rt.com/man/tcsh.1.html or type 'man tcsh' on the server, and look for the bindkey section. You can also download a keyboard definition file designed for solaris at ftp://ftp.hcl.com/pub/bbs/fontkbd/sunkbf.zip The instructions for installing it are at http://www.hummingbird.com/exceedusers/Jul2001/0044.html |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |