From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-users-return-23729-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 97914d88 for ; Fri, 26 Oct 2018 15:02:21 +0000 (UTC) Received: (qmail 26977 invoked by alias); 26 Oct 2018 15:02:07 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23729 Received: (qmail 22535 invoked by uid 1010); 26 Oct 2018 15:02:07 -0000 X-Qmail-Scanner-Diagnostics: from mailout2.w1.samsung.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(210.118.77.12):SA:0(-7.3/5.0):. Processed in 3.182613 secs); 26 Oct 2018 15:02:07 -0000 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181026145524euoutp02ed2dea3338426d6b26c711af8b6a5318~hMF0lRwYR0639806398euoutp02W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1540565724; bh=Lt9B+rGcJlO3rfPZ8gOlU/duk/UnaM7ZIR8ttewpa1I=; h=Subject:From:To:Date:In-Reply-To:References:From; b=QYUZ16VMbn/rdrZf2rqvl1BG9Jx8vLPfFHlucpgN5Rv+XRRPxRQmMXQpmpiLTnqv7 /HuhdZsOZy9z6VSE9FckxuS3m7RtOD6L9/zLAwbP+z99Ql8L7vJdyD4lbMMXjj2mz3 CEx1EU9NNSXW++1OA1LYsBSQwQ3tbzKZfcgJZMOA= X-AuditID: cbfec7f2-5e3ff70000001159-13-5bd32adb0344 Subject: Re: Completion issue when zsh is not the default shell From: Peter Stephenson To: Date: Fri, 26 Oct 2018 15:55:21 +0100 In-Reply-To: X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPIsWRmVeSWpSXmKPExsWy7djP87q3tS5HG0xYJGux4+RKRgdGj1UH PzAFMEZx2aSk5mSWpRbp2yVwZTz5uY6p4KlAxcmd3cwNjMd5uxg5OSQETCROb+lh7WLk4hAS WMEocWPDeUYIp4dJ4vTLR1BON5PEiYZ5TDAtPW1tLCC2kMByRolnCzjgir72fGCBcDYxSsxd 3ccE4VxglDj36DY7SIuwgL3E9dU3wdrZBAwlpm6azQhiiwiISzyb+Q0sziKgKvFxTT+YzSkQ KNFy9AE7xGoNiQ03j4GdwSsgKHFy5hOwGmYBeYnmrbOZQZZJCNxnk1jYupodoqhMYubfiVDN LhLPjr2H+kFY4tXxLVBxGYnTk3tYIJrbGSXWTHrNDuH0MEpsOnqHEaLKWqLv9kUgmwNonabE +l36EGFHiR9/uthBwhICfBI33gpCHMQnMWnbdGaIMK9ER5sQRLWaxI6mrYwQYRmJp2sUJjAq zULyzSwk38xCWLWAkXkVo3hqaXFuemqxYV5quV5xYm5xaV66XnJ+7iZGYDI4/e/4px2MXy8l HWIU4GBU4uGd8O1itBBrYllxZe4hRgkOZiURXiuZy9FCvCmJlVWpRfnxRaU5qcWHGKU5WJTE eZfN2xgtJJCeWJKanZpakFoEk2Xi4JRqYHRj0V3aINVimHrGuDuy0e/42r1SK0uWyh4pusdf E/u24m6NZU3buudMiya5zstdzjbB8RhvgGD+9zzRJHaBH1kb+KYnTU3VNty05ojXc/nGCBtN xc2B1ae+SHI+NTzh7b6CIcwlLmjzyy8ntAwCcw4brfus+CmdjSm2ZeFzjqXp/9J9Htu/VmIp zkg01GIuKk4EALghNlsCAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeLIzCtJLcpLzFFi42I5/e/4Pd1bWpejDX6+NLTYcXIlowOjx6qD H5gCGKP0bIryS0tSFTLyi0tslaINLYz0DC0t9IxMLPUMjc1jrYxMlfTtbFJSczLLUov07RL0 Mp78XMdU8FSg4uTObuYGxuO8XYycHBICJhI9bW0sXYxcHEICSxkl1p95wgqRkJH4dOUjO4Qt LPHnWhcbRFEnk8TS5gfsEM4mRolL16YzQTgXGCXaGs6xgLTwChhJ9HWdZwSxhQXsJa6vvgkW ZxMwlJi6aTZYXERAXOLZzG9gcRYBVYmPa/rBbE6BQImWozAbgG5a1gAxiFlAU6J1+2+omzQk Ntw8xgSxTFDi5MwnLBA18hLNW2czT2AUmoWkZRaSsllIyhYwMq9iFEktLc5Nzy020itOzC0u zUvXS87P3cQIjIBtx35u2cHY9S74EKMAB6MSD++EbxejhVgTy4orcw8xSnAwK4nwWslcjhbi TUmsrEotyo8vKs1JLT7EaAr00URmKdHkfGB05pXEG5oamltYGpobmxubWSiJ8543qIwSEkhP LEnNTk0tSC2C6WPi4JRqYOSfs55lfvLpzi2XtjLfl78oznQtNIpxul52/az43IkZ035dnLBU wivxSDyr2TXFtpyvJz6tKZNZemfp0qNa026vCpT+cLvGolJy67MfKs8S5EvXsq7mMrj19OzB RRzVd7lkmRpSg7iPXPtrMiNt5+/q09ftpl61a9qm8b3Of/qyeydXPfjwgqlRiaU4I9FQi7mo OBEAdnLCuJYCAAA= Message-Id: <20181026145522eucas1p245580c8ddf13dca70b5eae45af9a0205~hMFzZ7wLw1740617406eucas1p2G@eucas1p2.samsung.com> X-CMS-MailID: 20181026145522eucas1p245580c8ddf13dca70b5eae45af9a0205 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181026142713epcas1p2bcbd7c6efff6d9e809fdbedb51eb6eba X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181026142713epcas1p2bcbd7c6efff6d9e809fdbedb51eb6eba References: On Fri, 2018-10-26 at 16:25 +0200, Julien Nicoulaud wrote: > On my work machine bash is the default shell (AD accounts...), and I have > an issue with the SSH completion: >  > ssh stobash: _ssh_hosts: command not found... >  > Trace file (see line 622): https://pastebin.com/raw/eE6XJbg2 >  > It looks like at some point bash is invoked, which tries to resolve > _ssh_hosts and fails. >  > If I explicitly "autoload _ssh_hosts", it works correctly. It looks like a > bug to me ? It clearly shouldn't be running bash, but it's entirely unclear from what you say why it actually is.  So I'm just having to guess. Presumably _ssh_hosts is being found by your $path, rather than your $fpath, so being executed as a command rather than function  It's not clear why your system would be set up to find _ssh_hosts that way --- it means your shell function directory is being searched for commands --- but it's not actually a problem in general so long as the "autoload" has been done. Given that explicitly using "autoload" works, that means _ssh_hosts *is* also being found along $fpath. So the issue is it's not being marked for autoload automatically.  I can think of a few reasons for this: 1. When "compinit" is run, $fpath isn't yet set up properly.  You'd need to track this down in the initialisation sequence.  "compinit" clearly is being run, or the shell wouldn't know about any association between ssh completion _ssh_hosts. 2. You're hitting an old .zcompdump file that doesn't autoload this but for some reason doesn't get detected as out of date.  This isn't particularly likely but "rm ~/.zcompdump*" is an easy thing to try and only incurs a one-off reload penalty. 3. There's an alternative _ssh_hosts early in your $fpath and it doesn't contain the first line needed by the completion system, #autoload that you'll see in the file that comes with zsh.  This is probably my top guess.  Have a look at print -l $^fpath/_ssh_hosts(N) (expand fpath to include any occurence of _ssh_hosts but remove any entries that aren't matched as files). pws