zsh-users
 help / color / mirror / Atom feed
* How do I get rid of _complete_alias error generated by bash code?
@ 2021-09-15 20:48 Steve Dondley
  2021-09-15 20:54 ` Steve Dondley
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Steve Dondley @ 2021-09-15 20:48 UTC (permalink / raw)
  To: Zsh users

I'm migrating my stuff from bash to zsh. I'm a stymied by an error that 
crops up from time to time and I'm not sure how to fix.

In bash, I had these lines:

# completion commands
complete -F _complete_alias t
complete -F _complete_alias ta
complete -F _complete_alias tl
complete -F _complete_alias tm
complete -F _complete_alias tasn
complete -F _complete_alias tast
complete -F _complete_alias taa
complete -F _complete_alias tlst
complete -F _complete_alias tli
complete -F _complete_alias tpa
complete -F _complete_alias tlt
complete -F _complete_alias tai


I don't even remember why I had to put them in bash and I'm not sure 
they are needed in zsh. Initially, zsh doesn't complain about them at 
all. But then at some point, and I don't know when, I start getting an 
error when trying to use tab completion:

> $ tasn (anon):4: command not found: _complete_alias
(anon):4: command not found: _complete_alias
(anon):4: command not found: _complete_alias

I tried commenting out all the lines and reloading zsh but it still 
throws the errors. The (anon):4 isn't helpful to me so I don't know 
where the errors might be coming from. I grep'd the code and don't see 
any more instances of "_complete_alias". To get rid of the errors, I 
have to start a new zsh from scratch.

Can someone please help me determine:

1) If I need these lines in zsh
2) If they are needed, how do I keep them from throwing an error
3) How I track down these errors and get rid of them without restarting 
the shell?



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

* Re: How do I get rid of _complete_alias error generated by bash code?
  2021-09-15 20:48 How do I get rid of _complete_alias error generated by bash code? Steve Dondley
@ 2021-09-15 20:54 ` Steve Dondley
  2021-09-15 20:55 ` Roman Perepelitsa
  2021-09-15 21:20 ` Bart Schaefer
  2 siblings, 0 replies; 7+ messages in thread
From: Steve Dondley @ 2021-09-15 20:54 UTC (permalink / raw)
  To: Zsh users


> 
> 1) If I need these lines in zsh
> 2) If they are needed, how do I keep them from throwing an error
> 3) How I track down these errors and get rid of them without
> restarting the shell?

OK, I did a 'exec zsh' and that has fixed the errors. I've left the 
lines commented out and tab completion is still working.

I'm probably good. But if someone could reassure me, I'd appreciate it.



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

* Re: How do I get rid of _complete_alias error generated by bash code?
  2021-09-15 20:48 How do I get rid of _complete_alias error generated by bash code? Steve Dondley
  2021-09-15 20:54 ` Steve Dondley
@ 2021-09-15 20:55 ` Roman Perepelitsa
  2021-09-15 22:37   ` Steve Dondley
  2021-09-15 21:20 ` Bart Schaefer
  2 siblings, 1 reply; 7+ messages in thread
From: Roman Perepelitsa @ 2021-09-15 20:55 UTC (permalink / raw)
  To: Steve Dondley; +Cc: Zsh users

On Wed, Sep 15, 2021 at 10:48 PM Steve Dondley <s@dondley.com> wrote:
>
> I tried commenting out all the lines and reloading zsh ...

This is the way.

> ... but it still throws the errors.

My guess is that by "reloading zsh" you mean running `source
~/.zshrc`. If that's the case, this is the culprit. Try restarting zsh
for real. In most cases `exec zsh` is enough. When in doubt, reboot.

Roman.


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

* Re: How do I get rid of _complete_alias error generated by bash code?
  2021-09-15 20:48 How do I get rid of _complete_alias error generated by bash code? Steve Dondley
  2021-09-15 20:54 ` Steve Dondley
  2021-09-15 20:55 ` Roman Perepelitsa
@ 2021-09-15 21:20 ` Bart Schaefer
  2021-09-15 21:50   ` Bev In TX
  2 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2021-09-15 21:20 UTC (permalink / raw)
  To: Steve Dondley; +Cc: Zsh users

On Wed, Sep 15, 2021 at 1:48 PM Steve Dondley <s@dondley.com> wrote:
>
> I'm migrating my stuff from bash to zsh. I'm a stymied by an error that
> crops up from time to time and I'm not sure how to fix.
>
> In bash, I had these lines:
>
> # completion commands
> complete -F _complete_alias t

(and so on)

That means that at some other point in your bash startup, a function
named _complete_alias was defined, and you told bash to run that
function to complete the "t" (etc.) commands.

Removing these lines is probably the right thing, but otherwise you
need to port the _complete_alias definition into your zsh startup as
well.  You must already be loading bashcompinit if there is no
complaint about the "complete" command not being found.


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

* Re: How do I get rid of _complete_alias error generated by bash code?
  2021-09-15 21:20 ` Bart Schaefer
@ 2021-09-15 21:50   ` Bev In TX
  2021-09-15 22:29     ` Steve Dondley
  0 siblings, 1 reply; 7+ messages in thread
From: Bev In TX @ 2021-09-15 21:50 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Steve Dondley, Zsh users

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

> On Sep 15, 2021, at 4:33 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:
> 
>> On Wed, Sep 15, 2021 at 1:48 PM Steve Dondley <s@dondley.com> wrote:
>> 
>> I'm migrating my stuff from bash to zsh. I'm a stymied by an error that
>> crops up from time to time and I'm not sure how to fix.
>> 
>> In bash, I had these lines:
>> 
>> # completion commands
>> complete -F _complete_alias t
> 
> (and so on)
> 
> That means that at some other point in your bash startup, a function
> named _complete_alias was defined, and you told bash to run that
> function to complete the "t" (etc.) commands.
> 
> Removing these lines is probably the right thing, but otherwise you
> need to port the _complete_alias definition into your zsh startup as
> well.  You must already be loading bashcompinit if there is no
> complaint about the "complete" command not being found.
Perhaps the OP is using:
https://github.com/cykerway/complete-alias

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

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

* Re: How do I get rid of _complete_alias error generated by bash code?
  2021-09-15 21:50   ` Bev In TX
@ 2021-09-15 22:29     ` Steve Dondley
  0 siblings, 0 replies; 7+ messages in thread
From: Steve Dondley @ 2021-09-15 22:29 UTC (permalink / raw)
  To: zsh-users

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

On 2021-09-15 05:50 PM, Bev In TX wrote:

>> On Sep 15, 2021, at 4:33 PM, Bart Schaefer <schaefer@brasslantern.com> 
>> wrote:
> 
> On Wed, Sep 15, 2021 at 1:48 PM Steve Dondley <s@dondley.com> wrote: 
> I'm migrating my stuff from bash to zsh. I'm a stymied by an error that 
> crops up from time to time and I'm not sure how to fix. In bash, I had 
> these lines: # completion commands complete -F _complete_alias t
> (and so on)
> 
> That means that at some other point in your bash startup, a function
> named _complete_alias was defined, and you told bash to run that
> function to complete the "t" (etc.) commands.
> 
> Removing these lines is probably the right thing, but otherwise you
> need to port the _complete_alias definition into your zsh startup as
> well.  You must already be loading bashcompinit if there is no
> complaint about the "complete" command not being found.
  Perhaps the OP is using:
https://github.com/cykerway/complete-alias

This looks very vaguely familiar. I think you are right and I did use 
this. Thanks for googling that for me. :)

I've had a little too much wine with dinner to go back and figure out 
what I did 2 hours ago, never mind 2 years ago. I will review this 
tomorrow. Thanks!

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

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

* Re: How do I get rid of _complete_alias error generated by bash code?
  2021-09-15 20:55 ` Roman Perepelitsa
@ 2021-09-15 22:37   ` Steve Dondley
  0 siblings, 0 replies; 7+ messages in thread
From: Steve Dondley @ 2021-09-15 22:37 UTC (permalink / raw)
  To: zsh-users


> for real. In most cases `exec zsh` is enough. When in doubt, reboot.

Yes, soon after sending my email, I discovered `exec zsh`, similar to 
bash, works. I should have googled that first. Sorry to interrupt your 
day with a triviality.



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

end of thread, other threads:[~2021-09-15 22:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 20:48 How do I get rid of _complete_alias error generated by bash code? Steve Dondley
2021-09-15 20:54 ` Steve Dondley
2021-09-15 20:55 ` Roman Perepelitsa
2021-09-15 22:37   ` Steve Dondley
2021-09-15 21:20 ` Bart Schaefer
2021-09-15 21:50   ` Bev In TX
2021-09-15 22:29     ` Steve Dondley

zsh-users

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/zsh-users

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-users zsh-users/ https://inbox.vuxu.org/zsh-users \
		zsh-users@zsh.org
	public-inbox-index zsh-users

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.users


code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git