From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: .zsh_history
Date: Sat, 15 Apr 2023 08:29:58 -0700 [thread overview]
Message-ID: <fad9a4fb-2507-05ac-db12-8f08bb68bd95@eastlink.ca> (raw)
In-Reply-To: <CAMP44s0VXmPZ7ZXmgSFdLZFAtHmy-ToxWB8H9Ktp8B3EJ6fQQw@mail.gmail.com>
On 2023-04-14 21:49, Felipe Contreras wrote:
> *But* that doesn't mean everyone understands all the configurations.
That's for sure. Like anything that grew by accretion, not design, as
new features were tacked on, the documentation became more and more
incoherent. I don't even attempt to understand completion now, I threw
myself at it a couple of times and failed miserably. complete completer
completion completed completable ... only Satan really understands it.
> So I think a more accurate statement would be that the configuration
> is unidirectional: everyone understands their own configuration,
> because they had an idea of what made sense, looked for a way to
> achieve it, and found it. But other people have other ideas, and their
> configuration isn't necessarily understood by others.
Yup. Write-only configuration.
I'm 100% certain you can do that, but not with history expansion, you'll
> need to use zle for that.
I'd sure like to know how! Back in the day nobody seemed to know how to
do it, not even Bart. I came pretty close using 'noglob' and my
functions work OK, but it would be vastly simpler if I could recover
unexpanded command tails in some direct way. As it is I run the
function as an alias preceded by 'noglob' then save the literal text of
the command tail as needed then 'eval' it. Quite dumb, but it's the
only way that I've found.
> So you can write zle widgets to do anything you want to do with the
> current line, but that's significantly different from history
> substitution (e.g. !!0).
Never played with that. Don't know anything about it. All I want is to
be able to recover a command tail *exactly* as it was typed.
my_function ()
{
grab_tail # writes tail to 'my_tail'.
echo "my tail, exactly as typed, is: $my_tail"
}
$ my_function $path $(eval 'ls *') one two three ! < > ``.."" &>^!
my tail, exactly as typed, is: $path $(eval 'ls *') one two three ! < >
``.."" &>^!
... no simple thing, since it is the nature of shells to expand and
process command lines, not save them as typed. But history does almost
do it.
>
> Cheers.
>
next prev parent reply other threads:[~2023-04-15 15:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-08 16:16 .zsh_history Perry Smith
2023-04-08 16:53 ` .zsh_history Roman Perepelitsa
2023-04-08 17:23 ` .zsh_history Ray Andrews
2023-04-08 17:27 ` .zsh_history Roman Perepelitsa
2023-04-08 17:35 ` .zsh_history Perry Smith
2023-04-08 17:54 ` .zsh_history Ray Andrews
2023-04-14 14:36 ` .zsh_history Felipe Contreras
2023-04-14 15:27 ` .zsh_history Ray Andrews
2023-04-15 4:49 ` .zsh_history Felipe Contreras
2023-04-15 15:29 ` Ray Andrews [this message]
2023-04-15 19:47 ` "Pull just the text of a single command" (was Re: .zsh_history) Bart Schaefer
2023-04-15 22:47 ` Ray Andrews
2023-04-15 23:26 ` Bart Schaefer
2023-04-16 15:53 ` Bart Schaefer
2023-04-16 16:37 ` Ray Andrews
2023-04-16 19:24 ` Ray Andrews
2023-04-16 7:38 ` .zsh_history Roman Perepelitsa
2023-04-16 14:53 ` .zsh_history Ray Andrews
2023-04-16 15:28 ` .zsh_history Bart Schaefer
2023-04-16 15:29 ` .zsh_history Roman Perepelitsa
2023-04-14 14:28 ` .zsh_history Felipe Contreras
2023-04-14 15:18 ` .zsh_history Ray Andrews
2023-04-14 14:00 ` .zsh_history Felipe Contreras
2023-04-14 14:51 ` .zsh_history Felipe Contreras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fad9a4fb-2507-05ac-db12-8f08bb68bd95@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).