Mail Archives: cygwin/1999/12/09/15:42:51
CIRCUMSTANCES:
Reading from stdin under bash in rxvt window. Win95 OS. Cygwin 20.1. rxvt version that is pointed
out on CygWin site. The call to rxvt is:
rxvt -fn "-*-Courier-medium-r-*-13-*" -sl 2000 -e bash.
PROBLEM:
When I write simple C codes that require input from the keyboard ("Enter your nose diameter in
furlongs") I must type the input exactly right and cannot backspace to correct typing errors
without getting unintended behavior in the C code. A little experimenting confirms the obvious
suspicion, namely that the backspace character is just interpreted as part of the intended input.
This doesn' t happen in the regular DOS-box version of CygWin bash. Is there some fix for this
too-literal interpretation of the input, such as a change in some environmental variable or setting
some options in the call opening the rxvt window??
Thanks,
Garrett Sylvester
gsylvester AT gdats DOT com
P.S. A simple code that reproduces the problem and the output of cygcheck are edited in below.
=================================================================================
REPRODUCING THE PROBLEM: Compile and run the following C code, which simply converts the input
character string to its numerical ASCII representation. Use as input the 6-keystroke input
123[Backspace][Control-C][Enter], where [Backspace] is the backspace key, [Control-C] is the
Control-C key pair, and [Enter] is the "enter" or "return" key. The output will be:
123 (your input)
49 (ASCII code for 1)
50 (ASCII code for 2)
51 (ASCII code for 3)
8 (ASCII code for control-h or backspace).
Of course, what is wanted here as output is
12 (previous input with the 3 backspaced over)
49 (ASCII code for 2)
50 (ASCII code for 3).
Code:
#include <stdio.h>
/* Program to display ASCII numerical equivalents. Halts at ^c. */
main()
{
int a;
while((a = getchar()) != 3)
{
printf("%d\n",a);
}
}
OUTPUT FROM CYGCHECK
Cygnus Win95/NT Configuration Diagnostics
Current System Time: Thu Dec 09 15:33:20 1999
Win95 Ver 4.0 build 67306684 B
Path: .
/E/COMPILER/CYGWIN/CYGWIN~1/H-I586~1/BIN
/E/COMPILER/CYGWIN/CYGWIN~1/H-I586~1/USR/LOCAL/BIN
/E/MATH/MATLAB~2/BIN
/C/TNGSD/BIN
/C/WINDOWS
/C/WINDOWS/COMMAND
/E/COMPILER/WATCOMCC/BINNT
/E/COMPILER/WATCOMCC/BINW
/E/COMPILER/MS_IDE
/C/APPS/ANTIVI~1/MCAFEE
SysDir: C:\WINDOWS\SYSTEM
WinDir: C:\WINDOWS
CYGWIN = `tty'
HOME = `/home'
MAKE_MODE = `UNIX'
PWD = `/E/Compiler/CygWin/GSSCodes'
!C: = `C:\WINDOWS\DESKTOP'
!D: = `D:\Personal\Security'
!E: = `E:\COMPILER\CYGWIN\CYGWIN~1'
ASMROOT = `C:\TNGSD\SD'
BLASTER = `A220 I2 D1 T4'
CMDLINE = `bash --login'
COLORFGBG = `0;default;15'
COLORTERM = `rxvt-xpm'
COMSPEC = `C:\COMMAND.COM'
DISPLAY = `:0'
EDPATH = `E:\Compiler\WatcomCC\EDDAT'
HOSTNAME = `garrett_mobile.gdats.com'
HOSTTYPE = `i586'
INCLUDE = `E:\Compiler\WatcomCC\H;E:\Compiler\WatcomCC\H\NT'
MACHTYPE = `i586-pc-cygwin32'
OSTYPE = `cygwin32'
PROMPT = `$p$g'
PS1 = `\e[1m\e[34m% \e[0m'
SHELL = `/bin/sh'
SHLVL = `2'
TEMP = `C:\WINDOWS\TEMP'
TERM = `xterm'
TMP = `C:\WINDOWS\TEMP'
WATCOM = `E:\Compiler\WatcomCC'
WINBOOTDIR = `C:\WINDOWS'
WINDIR = `C:\WINDOWS'
WINDOWID = `39256240'
WWINHELP = `H:\BINW'
_ = `/E/COMPILER/CYGWIN/CYGWIN~1/H-I586~1/BIN/cygcheck'
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Favorites\Engineering
\CompSci\Cygnus
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Favorites\Engineering
\CompSci\Cygnus\Menu
(default) = (unsupported type)
HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
(default) = `F:'
unix = `/F'
fbinary = 0x00000000
fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
(default) = `E:'
unix = `/E'
fbinary = 0x00000000
fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
(default) = `D:'
unix = `/D'
fbinary = 0x00000000
fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
(default) = `C:'
unix = `/C'
fbinary = 0x00000000
fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
(default) = `E:\Compiler\CygWin\cygwin-b20\H-i586-cygwin32'
unix = `/'
fbinary = 0x00000000
fsilent = 0x00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cygnus Cygwin B20
(default) = `C:\WINDOWS\IsUninst.exe -fe:\compiler\cygwin\cygwin-b20\Uninst.isu'
DisplayName = `Cygwin B20'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20\B20.1
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32\cygwin-B20.1
(default) = `e:\compiler\cygwin\cygwin-b20'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D
a:\ fd N/A N/A
c:\ hd FAT32 992Mb 61% CP UN BOOT
d:\ hd FAT32 765Mb 37% CP UN WORK
e:\ hd FAT32 1675Mb 69% CP UN APPS
f:\ hd FAT32 4359Mb 82% CP UN DATA
g:\ cd N/A N/A
E:\Compiler\CygWin\cygwin-b20\H-i586-cygwin32 / native text!=binary
C: /C native text!=binary
D: /D native text!=binary
E: /E native text!=binary
F: /F native text!=binary
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\bash.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\cat.exe
Not Found: cpp (good!)
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\find.exe
Found: C:\WINDOWS\COMMAND\find.exe
Warning: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\find.exe hides C:\WINDOWS\COMMAND\find.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\gcc.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\gdb.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\ld.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\ls.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\make.exe
Found: E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\sh.exe
371k 1998/12/01 E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
"cygtcl80.dll" v0.0 ts=1998/12/1 3:25
5k 1998/12/01 E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
10k 1998/12/01 E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
"cygtclreg80.dll" v0.0 ts=1998/12/1 3:25
600k 1998/12/01 E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\cygtk80.dll - os=4.0 img=1.0 sys=4.0
"cygtk80.dll" v0.0 ts=1998/12/1 3:28
451k 1999/11/19 E:\COMPILER\CYGWIN\CYGWIN~1\H-I586~1\BIN\cygwin1.dll - os=4.0 img=1.0 sys=4.0
"cygwin1.dll" v0.0 ts=1999/1/16 0:09
Use -h to see help about each section
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -