Subject: bin/26046: vi filename completion bugs
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <lukem@NetBSD.org>
List: netbsd-bugs
Date: 06/25/2004 08:15:32
>Number:         26046
>Category:       bin
>Synopsis:       vi filename completion bugs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 24 22:16:01 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Luke Mewburn
>Release:        NetBSD 2.0C
>Organization:
The NetBSD Foundation
>Environment:
System: NetBSD argo 2.0C NetBSD 2.0C (LUKEM_SERVER from GENERIC-$Revision: 1.594 $) #0: Fri Apr 9 00:54:52 EST 2004 lukem@argo:/var/obj/i386/usr/src/sys/arch/i386/compile/LUKEM_SERVER i386
Architecture: i386
Machine: i386
>Description:
	vi supports filename completion, which I set to the <tab> key with:
		set filec=\<tab>

	However, certain characters in filenames are "special" to vi 
	and should be escaped in the "completed" name in the buffer.
	These characters include: %, #, and whitespace.

>How-To-Repeat:
	% mkdir testdir
	% cd testdir
	% touch 'test1' 'foo%bar' 'gee#wiz' 'hello there' 'tab<tab>here'
	% setenv EXINIT 'set filec=\<tab>'

	% vi
	:e te<tab>
	" expands to 'test1', opens as 'test1'
	" This is ok.
	:q

	% vi
	:e fo<tab>
	" expands to 'foo%bar', opens as 'foo/tmp/vi.09127bbar'
	" The expansion should be 'foo\%bar' so that the correct file is opened.
	:q

	% vi
	:e ge<tab>
	" expands to 'gee#wiz', vi errors with
	"	No filename to substitute for #.
	" The expansion should be 'gee\#wiz' so that the correct file is opened.
	:q

	% vi
	:e he<tab>
	" expands to 'hello there', vi errors with:
	"	Usage: [Ee][dit][!] [+cmd] [file].
	" It is not clear how to :e a file with a space in the name.
	:q

	% vi
	:e ta<tab>
	" expands to 'tab<tab>here', vi errors with:
	"	Usage: [Ee][dit][!] [+cmd] [file].
	" It is not clear how to :e a file with a tab in the name.
	:q


>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: