Re: How to make Cygwin map backspace to ASCII DEL?
Igor Pechtchanski [EMAIL PROTECTED] writes: man stty I'm well aware of the stty program. I was going to add please, don't suggest stty to my original mail, but thought it might be somewhat impolite. If you are trying to imply that 'stty erase $(tput kbs)' (where tput kbs outputs ASCII DEL) would do what I want, you must have misread the question. It doesn't and I think it shouldn't. Or is there some Cygwin specific extension in the stty program that does what I want? I don't see anything in stty(1). -- Hannu -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: How to make Cygwin map backspace to ASCII DEL?
On Fri, 19 Dec 2003, Hannu Koivisto wrote: Igor Pechtchanski [EMAIL PROTECTED] writes: man stty I'm well aware of the stty program. I was going to add please, don't suggest stty to my original mail, but thought it might be somewhat impolite. If you are trying to imply that 'stty erase $(tput kbs)' (where tput kbs outputs ASCII DEL) would do what I want, you must have misread the question. Yes, that's exactly what I meant to imply. Without further description of your problem, this is about as much advice as anyone can suggest. FYI, the terminfo database has changed a few times, and I'm not at all certain that the 'kbs' value stayed intact. On my system, 'tput kbs' prints ASCII BS. It doesn't and I think it shouldn't. Or is there some Cygwin specific extension in the stty program that does what I want? I don't see anything in stty(1). I still think 'stty' is what you want. Another place to look is the shell initialization files (e.g., the default /etc/profile has a bash-specific section that issues 'stty erase ^?' -- has that section become bash-specific recently?). Alternatively, look at the CVS history of fhandler_console.cc in winsup/cygwin. That should tell you if anything changed WRT the character produced by BackSpace. HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_[EMAIL PROTECTED] |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! I have since come to realize that being between your mentor and his route to the bathroom is a major career booster. -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: How to make Cygwin map backspace to ASCII DEL?
I don't use the zsh, but for bash you can modify your /etc/inputrc or ~/.inputrc file. I am sure there is an equivalent rc file for zsh. This link may help ... http://www.ibb.net/%7Eanne/keyboard/keyboard.html#Bash Greetings, I just upgraded all Cygwin packages to their latest versions. Although I don't use Cygwin a lot, I'm fairly sure that I would have noticed if backspace in an ordinary Windows console window had ended up as ^H to a Cygwin application (zsh in this case) running in that console window, which is what happens now. Anyway, whatever the old behaviour was, I want backspace to generate ASCII DEL (^?) and not ^H --- how can I make Cygwin do that? -- Hannu __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
How to make Cygwin map backspace to ASCII DEL?
Greetings, I just upgraded all Cygwin packages to their latest versions. Although I don't use Cygwin a lot, I'm fairly sure that I would have noticed if backspace in an ordinary Windows console window had ended up as ^H to a Cygwin application (zsh in this case) running in that console window, which is what happens now. Anyway, whatever the old behaviour was, I want backspace to generate ASCII DEL (^?) and not ^H --- how can I make Cygwin do that? -- Hannu -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: How to make Cygwin map backspace to ASCII DEL?
On Thu, 18 Dec 2003, Hannu Koivisto wrote: Greetings, I just upgraded all Cygwin packages to their latest versions. Although I don't use Cygwin a lot, I'm fairly sure that I would have noticed if backspace in an ordinary Windows console window had ended up as ^H to a Cygwin application (zsh in this case) running in that console window, which is what happens now. Anyway, whatever the old behaviour was, I want backspace to generate ASCII DEL (^?) and not ^H --- how can I make Cygwin do that? man stty Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_[EMAIL PROTECTED] |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! I have since come to realize that being between your mentor and his route to the bathroom is a major career booster. -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Ian schrieb: Hi, I've searched through the mailing list and have seen many posts related to backspace and delete behavior, so my apologies in advance for yet another one, but I can't seem to find the answer I'm looking for in the archives. Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08) for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E) for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be used by applications (e.g. emacs). This is how I've always configured other terminal emulators that I've used, and it has worked well. I believe Cygwin just repeats what it gets from Windows. Typically for the console this would changed via keymaps, but I don't see that Cygwin uses this. I don't want to change my mapping in Windows as obviously that would mess up my native environment. Is there a low level way to change the keymap for Cygwin? If not is there a source hack I could implement (and if so where in the source should I look)? I believe that this is already included in the FAQ, anyway: put a file called .inputrc into your home directory and add these lines: # This file is read by the 'readline' library # (the library which bash uses for its command- # line editing facility) # Make Home work \e[7~: beginning-of-line # Make End work \e[8~: end-of-line # Make Delete work \e[3~: delete-char # make Insert work \e[2~: paste-from-clipboard # \C-h: backward-delete-char # \C-?: backward-delete-char Backspace works for me out of thebox, so I cannot say which one will work for you. This works for bash and probably other shells that use readline. Gerrit -- =^..^= -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
From: Elfyn McBratney elfyn at cygwin dot com To: cygwin at cygwin dot com Date: Thu, 21 Aug 2003 06:01:54 +0100 Subject: Re: Map Backspace to ASCII DEL? References: [EMAIL PROTECTED] Reply-to: cygwin at cygwin dot com Ian Brandt [EMAIL PROTECTED] wrote: I've searched through the mailing list and have seen many posts related to backspace and delete behavior, so my apologies in advance for yet another one, but I can't seem to find the answer I'm looking for in the archives. Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08) for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E) for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be used by applications (e.g. emacs). This is how I've always configured other terminal emulators that I've used, and it has worked well. I believe Cygwin just repeats what it gets from Windows. Typically for the console this would changed via keymaps, but I don't see that Cygwin uses this. I don't want to change my mapping in Windows as obviously that would mess up my native environment. Is there a low level way to change the keymap for Cygwin? If not is there a source hack I could implement (and if so where in the source should I look)? `stty erase ^?', IIRC. -- Elfyn No! Stty settings don't change keyboard mappings. All the 'stty erase' setting does is to select the 'character delete' code for use in 'simple' terminal input (e.g. from applications like ftp as opposed to shells which handle line editing themselves). Setting stty erase ^? achieves nothing useful with the default key mappings, because you can't actually generate a delete character! I think that rxvt has the functionality which you require. For example: rxvt -backspacekey ^? -deletekey ^h will give you a session in which the backspace key generates ^h and the delete key generates ^?. (It might then be useful to issue stty -erase ^? so that you can use the backspace key to delete characters in simple terminal input.) In the case of emacs, have you tried running it under X11? In this mode it can distinguish between the backspace key (which it interprets as a 'delete last character' function) and ^h (which calls the help command). -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Hello Ian, my apologies, I'm still learning english;) Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08) for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E) for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be used by applications (e.g. emacs). This is how I've always configured # \C-h: backward-delete-char # \C-?: backward-delete-char At least I found the Bash builtin bind: bind -u backward-delete-char removes all bindings for the Backspace key so you can define ^H yourself with another Function. Gerrit -- =^..^= -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Gerrit P. Haase wrote: I believe that this is already included in the FAQ, anyway: put a file called .inputrc into your home directory and add these lines: # This file is read by the 'readline' library # (the library which bash uses for its command- # line editing facility) # Make Home work \e[7~: beginning-of-line # Make End work \e[8~: end-of-line # Make Delete work \e[3~: delete-char # make Insert work \e[2~: paste-from-clipboard # \C-h: backward-delete-char # \C-?: backward-delete-char Backspace works for me out of thebox, so I cannot say which one will work for you. This works for bash and probably other shells that use readline. Hi Gerrit, Thanks, but like stty this is too high level. This only tells applications that use the readline library what to do when they receive a certain character or string from the terminal. Readline, termcap/terminfo, and stty settings only change how the applications that use them react to a certain character/string. I'm looking to change the character/string that is sent to them for a particular keycode. In general it is a lot easier and there is a lot less to configure if the ASCII DEL character is sent for the Backspace keycode, and this also frees ASCII BS, or ^H, to be used by applications such as emacs. I would like to use Cygwin as my terminal and via ssh access several different machines, so minimizing the configuration required at each system is important. If I was on a Linux box I would accomplish this locally by changing the keymap using loadkeys, but this doesn't appear to be a part of the Cygwin port (and for all I know it may not be sensible on account of the Cygwin/Windows low-level details?). Just FYI for more info see: http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-2.html Thanks, Ian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Dr.D.J.Picton wrote: [snip] I think that rxvt has the functionality which you require. For example: rxvt -backspacekey ^? -deletekey ^h will give you a session in which the backspace key generates ^h and the delete key generates ^?. (It might then be useful to issue stty -erase ^? so that you can use the backspace key to delete characters in simple terminal input.) In the case of emacs, have you tried running it under X11? In this mode it can distinguish between the backspace key (which it interprets as a 'delete last character' function) and ^h (which calls the help command). rxvt is purely an X application though, no? I'm trying to get this going under the Cygwin console. For X I could use xmodmap which would change the binding before it got to rxvt, xterm, emacs, etc. I in fact often do use X by ssh'ing to a remote system with port forwarding. I use Exceed as my local X server and it has a xmodmap equivalent. It's nice because I can use the mouse for cut/copy/paste, but it is somewhat slow. For a quick session the cygwin terminal would be much more efficient, if I could get it to function properly! (Besides the backspace problem I'm having issues with running full screen applications such as less and emacs -nw. (It seems that some terminal capability is not performing as advertised as the screen ends up garbled on occasion. This is my next challenge.) Regards, Ian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
From: Ian Brandt ian at ianbrandt dot com To: Cygwin cygwin at cygwin dot com Date: Thu, 21 Aug 2003 09:16:44 -0400 Subject: Re: Map Backspace to ASCII DEL? References: [EMAIL PROTECTED] Dr.D.J.Picton wrote: [snip] I think that rxvt has the functionality which you require. For example: rxvt -backspacekey ^? -deletekey ^h [snip] rxvt is purely an X application though, no? I'm trying to get this going under the Cygwin console. For X I could use xmodmap which would change the binding before it got to rxvt, xterm, emacs, etc. Actually, rxvt has a native Windows mode (which will run if DISPLAY is unset), although it probably requires some of the X11R6 .dll files to run. So you could try using rxvt in place of a standard console by changing cygwin.bat to do: rxvt -backspacekey ^? -deletekey ^h -e bash --login The only problem I noticed was the small font (which you can change by pressing the '+' key on the keypad in conjunction with the shift key) and the fact that the DISPLAY variable is set (which could be fixed with an /etc/profile hack.) hack). -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Ian Brandt wrote: Dr.D.J.Picton wrote: [snip] I think that rxvt has the functionality which you require. For example: rxvt -backspacekey ^? -deletekey ^h will give you a session in which the backspace key generates ^h and the delete key generates ^?. (It might then be useful to issue stty -erase ^? so that you can use the backspace key to delete characters in simple terminal input.) In the case of emacs, have you tried running it under X11? In this mode it can distinguish between the backspace key (which it interprets as a 'delete last character' function) and ^h (which calls the help command). rxvt is purely an X application though, no? No. It's not a purely X only application. If you do not give it a -display nor have DISPLAY set then it works quite well with Windows - in fact better than the Cygwin console mode (with the exception of some programs that do not understand ptys like cleartool!). -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Dr.D.J.Picton wrote: Actually, rxvt has a native Windows mode (which will run if DISPLAY is unset), although it probably requires some of the X11R6 .dll files to run. So you could try using rxvt in place of a standard console by changing cygwin.bat to do: rxvt -backspacekey ^? -deletekey ^h -e bash --login Wow, go figure, it does run in a native window. That is pretty darn cool. Well, so far so good. I've got the keys mapped the way I want them. I like the way Cut/Copy/Paste works. I like that selections are line by line, as opposed to rectangular. Scroll wheel works. So far no problem with full screen apps such as emacs and less. The only problem I noticed was the small font (which you can change by pressing the '+' key on the keypad in conjunction with the shift key) and the fact that the DISPLAY variable is set (which could be fixed with an /etc/profile hack.) Good tips. I used to use xterm so rxvt seems pretty straight forward. I just had no idea it would run native like that. Many Thanks! Ian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Ian Brandt wrote: Wow, go figure, it does run in a native window. That is pretty darn cool. Well, so far so good. I've got the keys mapped the way I want them. I like the way Cut/Copy/Paste works. I like that selections are line by line, as opposed to rectangular. Scroll wheel works. So far no problem with full screen apps such as emacs and less. Yes very cool. I use it all the time. Here's another tip: Instead of wildly long invocation lines use ~/.Xdefaults to specify things that are common and possibly to create term types then use rxvt -name... For example, instead of $ rxvt -fn Lucida Console-*-15 -sl 500 -backspacekey ^? -deletekey ^? \ -bg # -fg Whtie -colorBD Blue -colorUL Red -cursor Red You can just do rxvt for your default rxvt. If you want different colors (or other things) then you can use rxvt -name hostb or rxvt -name hostc, etc, given the following ~/.XDefaults file. This allows you to keep all your terminal types or schemes neatly defined in one place. ! Rxvt defaults ! Global Settings *font: Lucida Console-*-15 *saveLines: 500 *termName: cygwin *scrollBar_right: True *geometry: 80x24 *loginShell:True *backspacekey: ^? *deletekey: ^h ! Default color scheme (when no -name is used): Rxvt.background:# Rxvt.foreground:White Rxvt.colorBD: Blue Rxvt.colorUL: Red Rxvt.cursorColor: Red ! Color scheme for hostb hostb.background: Slateblue hostb.foreground: White hostb.colorBD: Yellow hostb.colorUL: Red hostb.cursorColor: Yellow ! Color scheme for hostc hostc.background: Black hostc.foreground: White hostc.colorBD: Green hostc.colorUL: Orang hostc.cursorColor: Cyan -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Map Backspace to ASCII DEL?
Hi, I've searched through the mailing list and have seen many posts related to backspace and delete behavior, so my apologies in advance for yet another one, but I can't seem to find the answer I'm looking for in the archives. Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08) for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E) for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be used by applications (e.g. emacs). This is how I've always configured other terminal emulators that I've used, and it has worked well. I believe Cygwin just repeats what it gets from Windows. Typically for the console this would changed via keymaps, but I don't see that Cygwin uses this. I don't want to change my mapping in Windows as obviously that would mess up my native environment. Is there a low level way to change the keymap for Cygwin? If not is there a source hack I could implement (and if so where in the source should I look)? TIA, Ian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Ian Brandt [EMAIL PROTECTED] wrote: I've searched through the mailing list and have seen many posts related to backspace and delete behavior, so my apologies in advance for yet another one, but I can't seem to find the answer I'm looking for in the archives. Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08) for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E) for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be used by applications (e.g. emacs). This is how I've always configured other terminal emulators that I've used, and it has worked well. I believe Cygwin just repeats what it gets from Windows. Typically for the console this would changed via keymaps, but I don't see that Cygwin uses this. I don't want to change my mapping in Windows as obviously that would mess up my native environment. Is there a low level way to change the keymap for Cygwin? If not is there a source hack I could implement (and if so where in the source should I look)? `stty erase ^?', IIRC. -- Elfyn -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Map Backspace to ASCII DEL?
Hi, Thanks for the reply. I had tried that, but it seems to have no effect. If I type C-v Backspace I still get ^H... ~$ stty -a | grep erase intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = undef; ~$ ^H I believe that just tells the terminal what to do on the line when it receives ^?, but it this case it is not, it's getting ^H. I need to remap the key at a lower level, but hopefully still in Cygwin, not in Windows. ~Ian Elfyn McBratney wrote: Ian Brandt [EMAIL PROTECTED] wrote: I've searched through the mailing list and have seen many posts related to backspace and delete behavior, so my apologies in advance for yet another one, but I can't seem to find the answer I'm looking for in the archives. Currently it seems that the cygwin terminal sends ^H (ASCII BS, 0x08) for backspace, and the VT220 Remove escape sequence (\E[3~, 0x1B5B337E) for Delete. I'd like it to send ^? (ASCII DEL, 0x7F) so that ^H can be used by applications (e.g. emacs). This is how I've always configured other terminal emulators that I've used, and it has worked well. I believe Cygwin just repeats what it gets from Windows. Typically for the console this would changed via keymaps, but I don't see that Cygwin uses this. I don't want to change my mapping in Windows as obviously that would mess up my native environment. Is there a low level way to change the keymap for Cygwin? If not is there a source hack I could implement (and if so where in the source should I look)? `stty erase ^?', IIRC. -- Elfyn -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/