Error listing directory - escape codes issue?

Advertisement

Duke
Joined:
Posts:
2

Error listing directory - escape codes issue?

After upgrading from 4.0.7 to 4.1beta I encountered a problem listing directories on a specific system. The error I get is this:

Error listing directory '/home/user'.

Unexpected directory listing line 'total 171492'..
Invalid rights description '[0mtotal '

I'm wondering if this relates to escape codes in my shell's prompt or escape codes for a coloured directory listing. I would guess the former since the total appears on the first line and isn't coloured.

It could also relate to the preexec() and precmd() lines I have set in zsh to set the contents of the terminal program's title bar.

Anyhow, it's not a problem in 4.0.7.

Reply with quote

Advertisement

Duke
Joined:
Posts:
2

Re: Error listing directory - escape codes issue?

martin wrote:

Can you post a log file both for 4.0.7 and 4.1? Thanks.

I think I found the issue while examining the logs. It seems 4.1 doesn't unalias "ls" which I have aliased to 'ls --color' in my shell profile. 4.07 shows the unalias "ls" command in the log (I've put some context around the 'ls' line):

unalias "cd" ; echo "WinSCP: this is end-of-file:$status"
unalias: no such hash table element: cd
WinSCP: this is end-of-file:1
unalias "ls" ; echo "WinSCP: this is end-of-file:$status"
WinSCP: this is end-of-file:0
unalias "groups" ; echo "WinSCP: this is end-of-file:$status"
unalias: no such hash table element: groups

There is no 'unalias "ls"' line in the 4.1 log.

I'll post the difference between listings with and without colour as shown in the logs.

4.07:
Getting current directory name.
pwd ; echo "WinSCP: this is end-of-file:$status"
/home/user
WinSCP: this is end-of-file:0
Listing current directory.
ls -la --full-time ; echo "WinSCP: this is end-of-file:$status"
total 171788
drwxr-xr-x 43 user user      4096 2008-04-10 09:43:25.000000000 -0400 .
drwxr-xr-x 17 root    root         4096 2007-05-24 14:02:33.000000000 -0400 ..
drwxr-xr-x  6 user user      4096 2008-02-01 12:29:39.000000000 -0500 .vim
-rw-r-----  1 user user      9618 2008-04-04 10:09:09.000000000 -0400 .viminfo
-rw-r-----  2 user user      3609 2007-12-14 12:22:58.000000000 -0500 .vimrc
drwxr-xr-x  9 user user      4096 2008-01-15 22:53:14.000000000 -0500 Development
drwxr-xr-x  2 user user      4096 2007-01-28 23:22:16.000000000 -0500 Documentation
WinSCP: this is end-of-file:0
Directory listing with --full-time succeed, next time all errors during directory listing will be displayed immediatelly.
Startup conversation with host finished.

4.1:
. 2008-03-31 11:04:41.152 Getting current directory name.
> 2008-03-31 11:04:41.152 pwd ; echo "WinSCP: this is end-of-file:$status"
< 2008-03-31 11:04:41.246 /home/user
< 2008-03-31 11:04:41.246 WinSCP: this is end-of-file:0
. 2008-03-31 11:04:41.246 Listing current directory.
> 2008-03-31 11:04:41.246 ls -la --full-time ; echo "WinSCP: this is end-of-file:$status"
< 2008-03-31 11:04:41.480 total 171492
< 2008-03-31 11:04:41.480 drwxr-xr-x 43 user user      4096 2008-03-31 10:55:50.000000000 -0400 .
< 2008-03-31 11:04:41.480 drwxr-xr-x 17 root    root         4096 2007-05-24 14:02:33.000000000 -0400 ..
< 2008-03-31 11:04:41.480 -rw-------  1 user user     36546 2008-03-31 10:51:44.000000000 -0400 .history
< 2008-03-31 11:04:41.511 drwxr-xr-x  6 user user      4096 2008-02-01 12:29:39.000000000 -0500 .vim
< 2008-03-31 11:04:41.527 -rw-r-----  1 user user     10422 2008-03-31 09:40:42.000000000 -0400 .viminfo
< 2008-03-31 11:04:41.527 -rw-r-----  2 user user      3609 2007-12-14 12:22:58.000000000 -0500 .vimrc
< 2008-03-31 11:04:41.527 drwxr-xr-x  9 user user      4096 2008-01-15 22:53:14.000000000 -0500 Development
< 2008-03-31 11:04:41.527 drwxr-xr-x  2 user user      4096 2007-01-28 23:22:16.000000000 -0500 Documentation
< 2008-03-31 11:04:41.621 WinSCP: this is end-of-file:0
* 2008-03-31 11:04:41.621 (ETerminal) Unexpected directory listing line 'total 171492'.
* 2008-03-31 11:04:41.621 Invalid rights description '[0mtotal '
. 2008-03-31 11:04:41.621 Directory listing with --full-time failed, try again regular listing.
. 2008-03-31 11:04:41.621 Listing current directory.
> 2008-03-31 11:04:41.621 ls -la  ; echo "WinSCP: this is end-of-file:$status"
< 2008-03-31 11:04:41.793 total 171492
< 2008-03-31 11:04:41.793 drwxr-xr-x 43 user user      4096 Mar 31 10:55 .
< 2008-03-31 11:04:41.793 drwxr-xr-x 17 root    root         4096 May 24  2007 ..
< 2008-03-31 11:04:41.808 -rw-------  1 user user     36546 Mar 31 10:51 .history
< 2008-03-31 11:04:41.840 drwxr-xr-x  6 user user      4096 Feb  1 12:29 .vim
< 2008-03-31 11:04:41.855 -rw-r-----  1 user user     10422 Mar 31 09:40 .viminfo
< 2008-03-31 11:04:41.855 -rw-r-----  2 user user      3609 Dec 14 12:22 .vimrc
< 2008-03-31 11:04:41.871 drwxr-xr-x  9 user user      4096 Jan 15 22:53 Development
< 2008-03-31 11:04:41.871 drwxr-xr-x  2 user user      4096 Jan 28  2007 Documentation
< 2008-03-31 11:04:41.933 WinSCP: this is end-of-file:0
* 2008-03-31 11:04:41.933 (ECommand) Error listing directory '/home/user'.
* 2008-03-31 11:04:41.933 Unexpected directory listing line 'total 171492'.
* 2008-03-31 11:04:41.933 Invalid rights description '[0mtotal '
. 2008-03-31 11:12:58.735 Startup conversation with host finished.
. 2008-03-31 11:13:00.798 Closing connection.

Note all the escape codes corresponding to colour codes.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Error listing directory - escape codes issue?

Duke wrote:

I think I found the issue while examining the logs. It seems 4.1 doesn't unalias "ls" which I have aliased to 'ls --color' in my shell profile. 4.07 shows the unalias "ls" command in the log (I've put some context around the 'ls' line):
Sure, you are right. Thanks!
This issue has been added to tracker.

Reply with quote

Advertisement

You can post new topics in this forum