zsh-users
 help / color / mirror / code / Atom feed
* Re: closing named directory at command run [q:e:
  2023-09-14  1:07 closing named directory at command run [q:e: Sebastian Gniazdowski
@ 2023-09-13 23:35 ` Bart Schaefer
  2023-09-14 11:56   ` Sebastian Gniazdowski
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2023-09-13 23:35 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: Zsh Users

On Wed, Sep 13, 2023 at 11:06 AM Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> How to make the bracket automatically closed at command run?

The _dynamic_directory_name completion function already tries to do
this, but it's overridden by zsh_directory_name_generic.  The latter
needs to define a compadd -R remove_func that swaps the colon for a
bracket, and use that instead of the -r option at around line 150.


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

* closing named directory at command run [q:e:
@ 2023-09-14  1:07 Sebastian Gniazdowski
  2023-09-13 23:35 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Gniazdowski @ 2023-09-14  1:07 UTC (permalink / raw)
  To: Zsh Users

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

Hi,
when I complete the ~[dirs] the completion leaves a colon at end and leaves
the bracket open, like  $ cd ~[z;share:, Problem is when I run the command
it returns error:
cd ~[z:doc
zsh: bad pattern: ~[z:doc:

How to make the bracket automatically closed at command run?


-- 
Best regards,
Sebastian Gniazdowski

[-- Attachment #2: Type: text/html, Size: 946 bytes --]

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

* Re: closing named directory at command run [q:e:
  2023-09-13 23:35 ` Bart Schaefer
@ 2023-09-14 11:56   ` Sebastian Gniazdowski
  2023-09-14 16:49     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Gniazdowski @ 2023-09-14 11:56 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh Users

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

Thanks, I've implemented like you described, it works.


On Wed, 13 Sept 2023 at 18:35, Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Wed, Sep 13, 2023 at 11:06 AM Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
> >
> > How to make the bracket automatically closed at command run?
>
> The _dynamic_directory_name completion function already tries to do
> this, but it's overridden by zsh_directory_name_generic.  The latter
> needs to define a compadd -R remove_func that swaps the colon for a
> bracket, and use that instead of the -r option at around line 150.
>


-- 
Best regards,
Sebastian Gniazdowski

[-- Attachment #2: Type: text/html, Size: 1390 bytes --]

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

* Re: closing named directory at command run [q:e:
  2023-09-14 11:56   ` Sebastian Gniazdowski
@ 2023-09-14 16:49     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2023-09-14 16:49 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: Zsh Users

On Wed, Sep 13, 2023 at 9:55 PM Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>> On Wed, Sep 13, 2023 at 11:06 AM Sebastian Gniazdowski
>> <sgniazdowski@gmail.com> wrote:
>> >
>> > How to make the bracket automatically closed at command run?
>>
>> The _dynamic_directory_name completion function already tries to do
>> this, but it's overridden by zsh_directory_name_generic.  The latter
>> needs to define a compadd -R remove_func that swaps the colon for a
>> bracket, and use that instead of the -r option at around line 150.
>
> Thanks, I've implemented like you described, it works.

Could you share a patch?  No reason this couldn't be in the distributed version.


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

end of thread, other threads:[~2023-09-14 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-14  1:07 closing named directory at command run [q:e: Sebastian Gniazdowski
2023-09-13 23:35 ` Bart Schaefer
2023-09-14 11:56   ` Sebastian Gniazdowski
2023-09-14 16:49     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).