9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] bug in libcomplete?
@ 2004-02-14 19:01 Rob 'Commander' Pike
  0 siblings, 0 replies; 8+ messages in thread
From: Rob 'Commander' Pike @ 2004-02-14 19:01 UTC (permalink / raw)
  To: 9fans

that's embarrassing. let's close it.

-rob

libcomplete%% diff complete.c /sys/src/libcomplete
61,62c61
< 	if(n <= 0){
< 		close(fd);
---
> 	if(n <= 0)
64d62
< 	}
139d136
<   	close(fd);



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bug in libcomplete?
  2004-02-14 19:09       ` Rob Pike
@ 2004-02-14 21:57         ` boyd, rounin
  0 siblings, 0 replies; 8+ messages in thread
From: boyd, rounin @ 2004-02-14 21:57 UTC (permalink / raw)
  To: 9fans

> we've all seen linux's readline.  if it's not universal by design,
> don't make it semi-universal by hackery.

absolutely.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bug in libcomplete?
  2004-02-14 18:18     ` andrey mirtchovski
  2004-02-14 17:56       ` andrey mirtchovski
@ 2004-02-14 19:09       ` Rob Pike
  2004-02-14 21:57         ` boyd, rounin
  1 sibling, 1 reply; 8+ messages in thread
From: Rob Pike @ 2004-02-14 19:09 UTC (permalink / raw)
  To: 9fans

> Next question (please bear with me): Has anyone thought of making
> libcomplete suggest binaries when there's a match? It's more trivial
> to look
> in /bin then to parse $PATH the way bash is doing. On the other hand
> the
> semantics need to be thought of right -- does it show executable files
> when
> none of the local files match? does it put preference on executables
> than
> files in the current dir (when no partial match exists) and so on?
>
> Maybe it isn't worth it and just typing /bin before hitting Ins is the
> way
> to go?

sure.

> Lastly: what would it take to make libcomplete work in directories
> served by
> things like ftpfs, dossrv (9fat:) or 9fs (9fs sources)?

i put in file name completion because the file names i see have grown
long
and because working with people who have file name completion kinda
forces you into it because they name things given that ability.

however, i still hate it.  like history in the shell that doesn't work
in other
commands, completion becomes this thing that only works some times in
some contexts.  for instance, it doesn't work on the rhs of a cp command
and it certainly doesn't work in scp.  it doesn't work in the address
bar of
the browser.  and so on and so on.  at least here it's in the window
system,
which makes it a little more general than it is in other systems, but
it's
fundamentally not a universally available thing, nor can it be.

so i vote strongly against hacks to make it work more broadly.  that way
lie layers of hideous goo that i don't need to name explicitly because
we've all seen linux's readline.  if it's not universal by design,
don't make
it semi-universal by hackery.

-rob



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bug in libcomplete?
  2004-02-14 16:49   ` David Presotto
@ 2004-02-14 18:18     ` andrey mirtchovski
  2004-02-14 17:56       ` andrey mirtchovski
  2004-02-14 19:09       ` Rob Pike
  0 siblings, 2 replies; 8+ messages in thread
From: andrey mirtchovski @ 2004-02-14 18:18 UTC (permalink / raw)
  To: 9fans

On Sat, 14 Feb 2004, David Presotto wrote:

> done and sources updated

Thank you!

Next question (please bear with me): Has anyone thought of making
libcomplete suggest binaries when there's a match? It's more trivial to look
in /bin then to parse $PATH the way bash is doing. On the other hand the
semantics need to be thought of right -- does it show executable files when
none of the local files match? does it put preference on executables than
files in the current dir (when no partial match exists) and so on?

Maybe it isn't worth it and just typing /bin before hitting Ins is the way
to go?

Lastly: what would it take to make libcomplete work in directories served by
things like ftpfs, dossrv (9fat:) or 9fs (9fs sources)?

andrey





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bug in libcomplete?
  2004-02-14 18:18     ` andrey mirtchovski
@ 2004-02-14 17:56       ` andrey mirtchovski
  2004-02-14 19:09       ` Rob Pike
  1 sibling, 0 replies; 8+ messages in thread
From: andrey mirtchovski @ 2004-02-14 17:56 UTC (permalink / raw)
  To: 9fans

> Lastly:

I lied, there's more.

the file descriptor opened in /sys/src/libcomplete/complete.c:56 is
never closed, so if you're stubborn and keep pressing Ins or ctrl+f
you'll soon get a 'process exceeds 100 file descriptors' warning.  for
some reason this crashes my terminal when my connection to the file
server times out.

home% cd font
home% lsof | grep font
home% # hit Ins many times
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
[10646/ aurabesh/ cyberbit/ efont/ luxi/ quickbrown.txt tengwar/ ttf.tgz ttf/ unicode-all.txt unifont/ utf8demo.txt vera/]
home% lsof | grep font
16       0 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       1 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       2 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       3 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       4 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       5 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       6 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
16       7 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       0 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       1 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       2 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       3 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       4 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       5 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       6 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
86       7 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       0 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       1 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       2 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       3 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       4 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       5 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       6 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
87       7 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       0 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       1 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       2 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       3 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       4 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       5 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       6 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
89       7 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       0 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       1 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       2 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       3 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       4 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       5 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       6 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
90       7 r  M    9 (0000000000008b1a 615 80)  8192      970 /usr/andrey/font
home%



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bug in libcomplete?
  2004-02-14 16:35 ` Rob Pike
@ 2004-02-14 16:49   ` David Presotto
  2004-02-14 18:18     ` andrey mirtchovski
  0 siblings, 1 reply; 8+ messages in thread
From: David Presotto @ 2004-02-14 16:49 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 24 bytes --]

done and sources updated

[-- Attachment #2: Type: message/rfc822, Size: 3012 bytes --]

From: Rob Pike <rob@mightycheese.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] bug in libcomplete?
Date: Sat, 14 Feb 2004 08:35:48 -0800
Message-ID: <D85938EA-5F0B-11D8-A6FF-000A95B984D8@mightycheese.com>

no, the bug is rio. it doesn't set /dev/wdir in this case.

add
	if(dir)
		w->dir = estrdup(dir)
after the call to wsetname() in new() in /sys/src/cmd/rio/rio.c

-rob

On Saturday, February 14, 2004, at 07:15 AM, andrey mirtchovski wrote:

> libcomplete depends on 'cd' to find our which directory the user is
> in.  this breaks its behaviour with respect to programs which
> implicitly chdir when started, one example is the 'window' command --
> cd /tmp and run window, hit the complete key and you'll get the
> contents of your $home.  The following example is a freshly created
> window in the /tmp directory:
>
>
>
> 	home% pwd
> 	/tmp
> 	[bin/ lib/ tmp/]
> 	home% cd `{pwd}
> 	[58 files]
> 	home%
>
> pwd shows i'm in /tmp, completion thinks i'm in $home, then the same
> thing after "cd `{pwd}"
>
> andrey

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] bug in libcomplete?
  2004-02-14 15:15 andrey mirtchovski
@ 2004-02-14 16:35 ` Rob Pike
  2004-02-14 16:49   ` David Presotto
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Pike @ 2004-02-14 16:35 UTC (permalink / raw)
  To: 9fans

no, the bug is rio. it doesn't set /dev/wdir in this case.

add
	if(dir)
		w->dir = estrdup(dir)
after the call to wsetname() in new() in /sys/src/cmd/rio/rio.c

-rob

On Saturday, February 14, 2004, at 07:15 AM, andrey mirtchovski wrote:

> libcomplete depends on 'cd' to find our which directory the user is
> in.  this breaks its behaviour with respect to programs which
> implicitly chdir when started, one example is the 'window' command --
> cd /tmp and run window, hit the complete key and you'll get the
> contents of your $home.  The following example is a freshly created
> window in the /tmp directory:
>
>
>
> 	home% pwd
> 	/tmp
> 	[bin/ lib/ tmp/]
> 	home% cd `{pwd}
> 	[58 files]
> 	home%
>
> pwd shows i'm in /tmp, completion thinks i'm in $home, then the same
> thing after "cd `{pwd}"
>
> andrey



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [9fans] bug in libcomplete?
@ 2004-02-14 15:15 andrey mirtchovski
  2004-02-14 16:35 ` Rob Pike
  0 siblings, 1 reply; 8+ messages in thread
From: andrey mirtchovski @ 2004-02-14 15:15 UTC (permalink / raw)
  To: 9fans

libcomplete depends on 'cd' to find our which directory the user is
in.  this breaks its behaviour with respect to programs which
implicitly chdir when started, one example is the 'window' command --
cd /tmp and run window, hit the complete key and you'll get the
contents of your $home.  The following example is a freshly created
window in the /tmp directory:



	home% pwd
	/tmp
	[bin/ lib/ tmp/]
	home% cd `{pwd}
	[58 files]
	home%

pwd shows i'm in /tmp, completion thinks i'm in $home, then the same
thing after "cd `{pwd}"

andrey



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-02-14 21:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-14 19:01 [9fans] bug in libcomplete? Rob 'Commander' Pike
  -- strict thread matches above, loose matches on Subject: below --
2004-02-14 15:15 andrey mirtchovski
2004-02-14 16:35 ` Rob Pike
2004-02-14 16:49   ` David Presotto
2004-02-14 18:18     ` andrey mirtchovski
2004-02-14 17:56       ` andrey mirtchovski
2004-02-14 19:09       ` Rob Pike
2004-02-14 21:57         ` boyd, rounin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).