From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25121 invoked from network); 12 Sep 2021 02:27:07 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Sep 2021 02:27:07 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1631413627; b=dkSqYUoUmhLiR/Ne3V0f7eWjFeonJWt4PI4ACwaw9GD3xsrsX32Jq/CNoRIb6xFga0skrPcMxz 9TTTUnxDqZuJgj3BesE327PZBygPXtnUTw3uChPzG7eWE11IPyhCCXmhfR7GD6UIcQVNWL1bBF uuD+kV2FvSMvZy1SNqrYnxwwk0qetfI5+8qsUIhVtb44eIipiIJk3FLQp+wgYzcyZ1H0f58+98 gwgLBEu69i9cwQdc499j36ZP5NzuOMcH63zLjj1rRZixsSMErKfH8crNNOHy34BJmIVIut9h8N eKUBh1skOiDS22yM+oNp7uzWT5hb6kNXJYFHZggmQJjc5g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-yb1-f173.google.com) smtp.remote-ip=209.85.219.173; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1631413627; bh=GFNozgySm8HF/LgGedtb6O/wn2T6hBRlyZ3+Zj9PsWQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=U8IFR4ZMH9VQamqmZrsxHPTkrzQGJqli5B/Pq7cHk/EqsCsHMKy9mgp5B9jUl1Cq8plKWc7U5h JG4R3lp7OyjuWyoSecHpN/81dN6YtW7XX5aG4pYnfjpmC7MgGQr+hiDkdtdsHKX7pkdFNS94Q9 MhOSgVKUZrq9J5NDc3vSGLP6UGgSgp7Eatzw/iSu4l8Bf0cv56BBhzotWUznZtpeTZt2fGBuRz yIlpRzsnsxClLUg8Ys6hwC8Byge24c9zfmjxCKMh11nJlKB3SGvElN3d/AAmBsSUmZUDqlx0BJ bo653ELycOa7e9cZFfa+4wPtNJvqMz8EmpaO7NM0y4YEOg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=wM6Qm3EnCbUukUbvZatcR6LkwVuqGRLYX/eMStNvBlk=; b=PXiqsSimuDkjwOo/3O/BluLaVa qW2nSEYWUkK1Lu8yjgIniDUJtY3hOdg2Rsv17JWHFlAGALT369giLBmozclqeomZ6DVVOGjvfoiy6 KCzTfEhZBn6i6bPWOYqFoV4x7TWKirVL0SXpqjBFOeKLEume3vR++BNrqTHa4llzYqCFxMpfbB+rf dt23xEvsJi8xaASi0K84iXARA2VQ31RS8CF5YgCQ6nuTIz58hallEPjbdEt+cZb2+HgDdR6yAbGjF U5JVhQL1fRWKRDiQyMa+dee7MkOM8OOJsdAHqcHpTfOxdhSt3l6+b+dsdPzPoJZTZQCLFf8nUuX/z PCPIwegQ==; Received: from authenticated user by zero.zsh.org with local id 1mPFD0-000Ixb-0j; Sun, 12 Sep 2021 02:27:06 +0000 Authentication-Results: zsh.org; iprev=pass (mail-yb1-f173.google.com) smtp.remote-ip=209.85.219.173; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-yb1-f173.google.com ([209.85.219.173]:38863) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mPFCB-000IFR-H4; Sun, 12 Sep 2021 02:26:17 +0000 Received: by mail-yb1-f173.google.com with SMTP id m70so11465060ybm.5 for ; Sat, 11 Sep 2021 19:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wM6Qm3EnCbUukUbvZatcR6LkwVuqGRLYX/eMStNvBlk=; b=DMHBRTBaRA54Avh9lRefPp4DTagul2TpxPxiV2CrGytoMU95DIQHxDlRBhYe1lgT90 iWc0pEW2EWFFYKmiQ1OTWJitX7vrJDEB2pawFHOybArIkxCXwLCHAEfaEcuV/eTwyh1v I2EXUJ2rj74l/jfds/GBezSCjOSu6zH67H4gIan17cRc02+329xXluZVIGgSEk2aPWlK phgKUskU3RBJZtBBI8BP1fenf+pt3kLtYAs3Mr7q88VafL8wH6sr/mpNqUBqbzje0SfD IYpIXwrV+KNWcnu6ZER87uN+OBox77kDW9GdOJnT2Z+gTwUhaQGHMI4tv+Rlh/GimyO8 DdeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wM6Qm3EnCbUukUbvZatcR6LkwVuqGRLYX/eMStNvBlk=; b=zBPpb5dbBnu/gd1X9eKDQyzAp+lYOKx7/bQnK+4t5zF23a4kADajWH9J6Axdv5/X2x j8YXy71wPeGaSiTd21iqFGNvu1s/VVmNL5ByOjcIc+n4lQ0vbucqsA/+FMKQdaUaYJe+ YtGUk3tnPD6jKb9IzO2bKhnLr+CU/s7jydjAa+Rpub5AOJchG8C1cyEos1gA+Pu3afJa 6nBhuCseTxMQKp2Xl7QruRfBvw+a7iN4lYp6GFHMI6NPIa5Hc+myHFR0JVDONg/vSOUR K8Lw+d27kukXaNDTDX4bS4WH7LOFlWgsYcl64wKrRfMT4YtYWngj4SBNqbjgQ8HzKWRJ ktAA== X-Gm-Message-State: AOAM530dAcvpuqbWPvzdT4hMhKMkOmXfGWtbiMEIz8StvVG7fHKuMKSw QcdaSUDal6MFG+4tVbFEBdLDV/u1PsURpoUBiR+vOq/2lJAz2A== X-Google-Smtp-Source: ABdhPJyb6JwKxw2eN5hsiWpXcGkSV6/2CErN18RE63bWYxl+864l6ocIwhU9Hx/GkXIrqCLio+U6KfW21IBgSKBPhxk= X-Received: by 2002:a25:21c5:: with SMTP id h188mr6207621ybh.23.1631413574390; Sat, 11 Sep 2021 19:26:14 -0700 (PDT) MIME-Version: 1.0 References: <8432871497e50ae7a6136a9e03a09ad6@dondley.com> <4df9fd0786c03076984bfd7d5cccc34c6780f519.camel@ntlworld.com> <01fed731885d32a336c7b0f31c8f4156@dondley.com> <88e7249e-09d7-4fc2-8b7f-d9e00c86f44f@www.fastmail.com> <15168b1d0f01d2561fd2186eb80b2479@dondley.com> In-Reply-To: <15168b1d0f01d2561fd2186eb80b2479@dondley.com> From: Bart Schaefer Date: Sat, 11 Sep 2021 19:26:03 -0700 Message-ID: Subject: Re: Is there any possible way to automatically escape characters when executing an alias in zsh? To: Steve Dondley Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 27116 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sat, Sep 11, 2021 at 6:27 PM Steve Dondley wrote: > > If I launch a command with the shell > and pass it some argument to open up a full-blown GUI for with a > particular color theme, that doesn't mean I'm interacting with the > shell. You're interacting with the up the point where you launch the command, and then you're interacting with the application you launched. > And what could possibly be the harm in having the shell do some typing > for me without me having to think about it? Having the shell do some typing for you is not the same as having the shell ignore something you typed in a context where it would normally pay attention. Eventually you're going to type something the shell should not have ignored and the wrong thing is going to happen. See for example url-quote-magic. That does the typing for you, and you can see what it did to make sure it didn't do anything wrong. PWS's solution (and even my edit thereof) change the input at a time and place where it's too late for you to fix anything that's awry. > > zle -N taskwarrior-literal > > autoload add-zle-hook-widget > > add-zle-hook-widget line-finish taskwarrior-literal > > Yeah, so I don't think this would work because I need for > autocompletion. Or am I not understanding this? You're not understanding. Given that you said -- > minor completions (none of which will ever contain special characters > that need to be escaped) -- taskwarrior-literal should work fine. As with PWS's suggestion, this kicks in when you press enter (accept-line), so all your completions are already out of the way, and it only quotes things that need quoting. The difference is that it blindly quotes ANYTHING that might be interpreted by the shell, including filename globs, etc.