I just downloaded and installed the latest (2 days old, at the time I write
this) version of Cygwin. I had several issues relating back to my Home
directory having spaces from my XP profile; mostly from external apps such
as KDE. I expect this is known, and I have looked it up in the archives and
in Google, but whether or not there is curently a resolution is not clear.
Below is my fix in the hopes that it is helpful (I couldn't find anything
similar as I searched.)

First, however, it appears that this is not supposed to be the standard
behavior. According to this post:
http://www.cygwin.com/ml/cygwin/2003-01/msg00111.html
it seems that this behavior is attributed to a HOME directory being set in
the environment. In my case, this is not so, as you can see from the
attached cygcheck output. 

If I install cygwin and run Bash on a clean machine, the path with spaces is
already set in etc/passwd as below, so I changed it to the short filename
version and that fixed most of the issues I was having.

NBRYANT:unused_by_nt/2000/xp:198884:10545:NBRYANT,U-WFBS\NBRYANT,S-1-5-21-[r
emoved]:/cygdrive/c/Documents and Settings/NBRYANT:/bin/bash

In the archives, I found mention that setting this in the cygwin.bat file is
a bad idea because of the possibility of mixing up docume~1 and docume~2,
etc. If this is the only issue with short file names, then I submit my
modified cygwin.bat file.
============================================================================
==
@echo off

IF NOT DEFINED HOME (
 for %%x IN (%USERPROFILE%) DO (set HOME=%%x)
 if NOT "%HOME%"=="%USERPROFILE%" (
  if "%OS%"=="Windows_NT" (
   for /D %%x IN ("%USERPROFILE%") DO (set HOME=%%~fsx)
  )
 )
)

C:
chdir C:\cygwin\bin

bash --login -i %1
============================================================================
==

This will set the HOME variable in the shell to the shortfilename version of
%USERPROFILE% and should work in any version of NT (I've only tried it in
XP, and it works just fine.) It cleared up my issues with KDE and other
software instantly.

I typed this up only in the hopes of contributing something to your
excellent project ... if it is counterproductive or actually has been
addressed, I apologize. On the other hand, if it would be helpful, you are
free to use it; I wrote it, it's mine, and I give it to you. If there is
interest, I should be able to expand it to '95/'98 (which you have to
shorten a different way).

Actually, while I'm at it, this should work for all versions (again, I've
only tested it on XP.
============================================================================
==
@echo off

C:
chdir C:\cygwin\bin

IF NOT DEFINED HOME (
 for %%x IN (%USERPROFILE%) DO (set HOME=%%x)
 if NOT "%HOME%"=="%USERPROFILE%" (
  if "%OS%"=="Windows_NT" (
   for /D %%x IN ("%USERPROFILE%") DO (set HOME=%%~fsx)
  ) ELSE (
   REM For Win9x, etc
   cygpath -d "%USERPROFILE%"| cat -b > sethome.bat
   echo set HOME=%%1>1.bat
   call sethome.bat
   del sethome.bat
   del 1.bat
  )
 )
)

bash --login -i %1
============================================================================
==

Incidentally, the %1 in the last line allows me to run shell scripts
directly from Win shortcuts, but does not affect normal execution: ie, since
the startx.bat files won't show the background when windowed, my shortcut is
thus:

C:\cygwin\cygwin.bat C:\cygwin\usr\X11R6\bin\kde.sh

But when the desktop Cygwin icon is launched, it functions as always.

~Neil

Cygwin Configuration Diagnostics
Current System Time: Mon Sep 13 12:28:07 2004

Windows XP Professional Ver 5.1 Build 2600 Service Pack 1

Path:   C:\cygwin\usr\local\bin
        C:\cygwin\bin
        C:\cygwin\bin
        C:\cygwin\usr\X11R6\bin
        c:\WINDOWS\system32
        c:\WINDOWS
        c:\WINDOWS\System32\Wbem
        c:\Program Files\NetManage\Windows
        c:\Program Files\Compuware\Common
        .\

Output from C:\cygwin\bin\id.exe (nontsec)
UID: 198884(NBRYANT) GID: 10545(mkgroup-l-d)
10545(mkgroup-l-d)

Output from C:\cygwin\bin\id.exe (ntsec)
UID: 198884(NBRYANT) GID: 10545(mkgroup-l-d)
0(root)              544(Administrators)  
547(Power Users)     545(Users)           10545(mkgroup-l-d)

SysDir: C:\WINDOWS\System32
WinDir: C:\WINDOWS

HOME = `c:\Documents and Settings\NBRYANT'
MAKE_MODE = `unix'
PWD = `/cygdrive/c/Documents and Settings/NBRYANT/desktop/new folder'
USER = `NBRYANT'

ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
APPDATA = `C:\Documents and Settings\NBRYANT\Application Data'
CLASSPATH = `C:\Classpath\swingall.jar'
CLIENTNAME = `Console'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
COMPUTERNAME = `DWS1257-B9KW141'
COMSPEC = `C:\WINDOWS\system32\cmd.exe'
CVS_RSH = `/bin/ssh'
HOMEDRIVE = `C:'
HOMEPATH = `\Documents and Settings\NBRYANT'
HOSTNAME = `DWS1257-B9KW141'
INFOPATH = 
`/usr/local/info:/usr/info:/usr/share/info:/usr/autotool/devel/info:/usr/autotool/stable/info:'
LOGONSERVER = `\\[removed]'
MANPATH = `/usr/local/man:/usr/man:/usr/share/man:/usr/autotool/devel/man:'
NUMBER_OF_PROCESSORS = `1'
OLDPWD = `/cygdrive/c/Documents and Settings/NBRYANT/desktop'
OS = `Windows_NT'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PRINTER = `ActiveTouch Document Loader'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 15 Model 2 Stepping 7, GenuineIntel'
PROCESSOR_LEVEL = `15'
PROCESSOR_REVISION = `0207'
PROGRAMFILES = `C:\Program Files'
PROMPT = `$P$G'
PS1 = `\[\033]0;\w\007
[EMAIL PROTECTED] \[\033[33m\w\033[0m\]
$ '
SESSIONNAME = `Console'
SHLVL = `1'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINDOWS'
TEMP = `C:\DOCUME~1\NBRYANT\LOCALS~1\Temp'
TERM = `cygwin'
TMP = `C:\DOCUME~1\NBRYANT\LOCALS~1\Temp'
USERDOMAIN = `WFBS'
USERNAME = `NBRYANT'
USERPROFILE = `C:\Documents and Settings\NBRYANT'
WINDIR = `C:\WINDOWS'
_ = `/usr/bin/cygcheck'
POSIXLY_CORRECT = `1'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `C:\cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `C:\cygwin/bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `C:\cygwin/lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

a:  fd           N/A    N/A                    
c:  hd  NTFS   38138Mb  15% CP CS UN PA FC     
d:  cd           N/A    N/A                    

C:\cygwin      /          system  binmode
C:\cygwin/bin  /usr/bin   system  binmode
C:\cygwin/lib  /usr/lib   system  binmode
.              /cygdrive  system  binmode,cygdrive

Found: C:\cygwin\bin\awk.exe
Found: C:\cygwin\bin\bash.exe
Found: C:\cygwin\bin\cat.exe
Found: C:\cygwin\bin\cp.exe
Not Found: cpp (good!)
Found: C:\cygwin\bin\find.exe
Not Found: gcc
Not Found: gdb
Found: C:\cygwin\bin\grep.exe
Not Found: ld
Found: C:\cygwin\bin\ls.exe
Not Found: make
Found: C:\cygwin\bin\mv.exe
Found: C:\cygwin\bin\rm.exe
Found: C:\cygwin\bin\sed.exe
Found: C:\cygwin\bin\sh.exe
Found: C:\cygwin\bin\tar.exe

   61k 2003/08/09 C:\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2003/8/9 2:35
   45k 2001/04/25 C:\cygwin\bin\cygform5.dll - os=4.0 img=1.0 sys=4.0
                  "cygform5.dll" v0.0 ts=2001/4/25 1:28
   35k 2002/01/09 C:\cygwin\bin\cygform6.dll - os=4.0 img=1.0 sys=4.0
                  "cygform6.dll" v0.0 ts=2002/1/9 1:03
   48k 2003/08/09 C:\cygwin\bin\cygform7.dll - os=4.0 img=1.0 sys=4.0
                  "cygform7.dll" v0.0 ts=2003/8/9 5:25
   28k 2003/07/20 C:\cygwin\bin\cyggdbm-3.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm-3.dll" v0.0 ts=2003/7/20 3:58
   30k 2003/08/11 C:\cygwin\bin\cyggdbm-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm-4.dll" v0.0 ts=2003/8/10 22:12
   19k 2003/03/22 C:\cygwin\bin\cyggdbm.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm.dll" v0.0 ts=2002/2/19 22:05
   15k 2003/07/20 C:\cygwin\bin\cyggdbm_compat-3.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm_compat-3.dll" v0.0 ts=2003/7/20 4:00
   15k 2003/08/11 C:\cygwin\bin\cyggdbm_compat-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm_compat-4.dll" v0.0 ts=2003/8/10 22:13
  107k 2004/07/06 C:\cygwin\bin\cyggettextlib-0-14-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyggettextlib-0-14-1.dll" v0.0 ts=2004/7/6 13:56
   17k 2004/07/06 C:\cygwin\bin\cyggettextpo-0.dll - os=4.0 img=1.0 sys=4.0
                  "cyggettextpo-0.dll" v0.0 ts=2004/7/6 13:56
  190k 2004/07/06 C:\cygwin\bin\cyggettextsrc-0-14-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyggettextsrc-0-14-1.dll" v0.0 ts=2004/7/6 13:56
   17k 2001/06/28 C:\cygwin\bin\cyghistory4.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory4.dll" v0.0 ts=2001/1/6 23:34
   29k 2003/08/10 C:\cygwin\bin\cyghistory5.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory5.dll" v0.0 ts=2003/8/10 19:16
  991k 2004/07/06 C:\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2004/7/6 14:10
   22k 2001/12/13 C:\cygwin\bin\cygintl-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-1.dll" v0.0 ts=2001/12/13 4:28
   37k 2003/08/10 C:\cygwin\bin\cygintl-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-2.dll" v0.0 ts=2003/8/10 17:50
   54k 2004/07/06 C:\cygwin\bin\cygintl-3.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-3.dll" v0.0 ts=2004/7/6 13:51
   26k 2001/04/25 C:\cygwin\bin\cygmenu5.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu5.dll" v0.0 ts=2001/4/25 1:27
   20k 2002/01/09 C:\cygwin\bin\cygmenu6.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu6.dll" v0.0 ts=2002/1/9 1:03
   29k 2003/08/09 C:\cygwin\bin\cygmenu7.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu7.dll" v0.0 ts=2003/8/9 5:25
  156k 2001/04/25 C:\cygwin\bin\cygncurses++5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++5.dll" v0.0 ts=2001/4/25 1:29
  175k 2002/01/09 C:\cygwin\bin\cygncurses++6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++6.dll" v0.0 ts=2002/1/9 1:03
  226k 2001/04/25 C:\cygwin\bin\cygncurses5.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses5.dll" v0.0 ts=2001/4/25 1:17
  202k 2002/01/09 C:\cygwin\bin\cygncurses6.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses6.dll" v0.0 ts=2002/1/9 1:03
  224k 2003/08/09 C:\cygwin\bin\cygncurses7.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses7.dll" v0.0 ts=2003/8/9 5:24
   15k 2001/04/25 C:\cygwin\bin\cygpanel5.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel5.dll" v0.0 ts=2001/4/25 1:27
   12k 2002/01/09 C:\cygwin\bin\cygpanel6.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel6.dll" v0.0 ts=2002/1/9 1:03
   19k 2003/08/09 C:\cygwin\bin\cygpanel7.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel7.dll" v0.0 ts=2003/8/9 5:24
   62k 2003/12/11 C:\cygwin\bin\cygpcre-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre-0.dll" v0.0 ts=2003/12/11 12:01
   63k 2003/04/11 C:\cygwin\bin\cygpcre.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre.dll" v0.0 ts=2003/4/11 4:31
    9k 2003/12/11 C:\cygwin\bin\cygpcreposix-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix-0.dll" v0.0 ts=2003/12/11 12:01
   61k 2003/04/11 C:\cygwin\bin\cygpcreposix.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix.dll" v0.0 ts=2003/4/11 4:31
  108k 2001/06/28 C:\cygwin\bin\cygreadline4.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline4.dll" v0.0 ts=2001/1/6 23:34
  148k 2003/08/10 C:\cygwin\bin\cygreadline5.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline5.dll" v0.0 ts=2003/8/10 19:16
   61k 2003/12/04 C:\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2003/12/3 22:03
 1111k 2004/09/05 C:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2004/9/4 23:17
    Cygwin DLL version info:
        DLL version: 1.5.11
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 116
        Shared data: 4
        DLL identifier: cygwin1
        Mount registry: 2
        Cygnus registry name: Cygnus Solutions
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Cygwin mount registry name: mounts v2
        Cygdrive flags: cygdrive flags
        Cygdrive prefix: cygdrive prefix
        Cygdrive default prefix: 
        Build date: Sat Sep 4 23:17:09 EDT 2004
        Shared id: cygwin1S4


Cygwin Package Information
Last downloaded files to: \\Dws1257-3gg7r21\Cygwin\packages
Last downloaded files from: \\Dws1257-3gg7r21\Cygwin\packages

Package              Version            
_update-info-dir     00227-1            
ash                  20040127-1         
base-files           3.0-3              
base-passwd          2.0-1              
bash                 2.05b-16           
bzip2                1.0.2-5            
cygwin               1.5.11-1           
diffutils            2.8.7-1            
editrights           1.01-1             
fileutils            4.1-2              
findutils            4.1.7-4            
gawk                 3.1.4-3            
gdbm                 1.8.3-7            
grep                 2.5-1              
groff                1.18.1-2           
gzip                 1.3.5-1            
less                 381-1              
libbz2_1             1.0.2-5            
libgdbm              1.8.0-5            
libgdbm-devel        1.8.3-7            
libgdbm3             1.8.3-3            
libgdbm4             1.8.3-7            
libgettextpo0        0.14.1-1           
libiconv2            1.9.2-1            
libintl1             0.10.40-1          
libintl2             0.12.1-3           
libintl3             0.14.1-1           
libncurses5          5.2-1              
libncurses6          5.2-8              
libncurses7          5.3-4              
libpcre              4.1-1              
libpcre0             4.5-1              
libreadline4         4.1-2              
libreadline5         4.3-5              
login                1.9-7              
man                  1.5k-3             
mktemp               1.5-3              
ncurses              5.3-4              
readline             4.3-5              
sed                  4.1.2-1            
sh-utils             2.0.15-4           
tar                  1.13.25-5          
termcap              20021106-2         
terminfo             5.3_20030726-1     
texinfo              4.2-4              
textutils            2.0.21-1           
which                1.5-2              
zlib                 1.2.1-1            
Use -h to see help about each section

--
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/

Reply via email to