Bug 32639 - broken last-argument history
Summary: broken last-argument history
Status: ASSIGNED
Alias: None
Product: Sisyphus
Classification: Development
Component: zsh (show other bugs)
Version: unstable
Hardware: all Linux
: P3 minor
Assignee: Fr. Br. George
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-20 20:53 MSK by Michael Shigorin
Modified: 2023-04-27 12:31 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Shigorin 2016-10-20 20:53:34 MSK
$ grep '()
[pressed Enter too early, typing mistake]
quote> 
[pressed Ctrl-C]
$ grep '()' 
[pressed Alt-. thrice to recall the last argument of a preceding command]
$ grep '()' '()'()'()

2 george: I understand it's not the package bug but upstream one,
          chose to post at least here before leaving the office...
Comment 1 Fr. Br. George 2016-12-14 14:18:56 MSK
How very funny :(
Comment 2 Fr. Br. George 2017-02-09 09:48:03 MSK
Now, after a time passed, I can not guess, why it is a bug? Seems to me "'()" is actual last argument. So what do we expect intead7
Comment 3 Michael Shigorin 2017-02-09 15:40:59 MSK
(В ответ на комментарий №2)
> So what do we expect intead7
"Scrolling" three last-arg history positions up, obviously.
Comment 4 Arseny Maslennikov 2023-04-27 12:31:23 MSK
(In reply to Michael Shigorin from comment #3)
> (В ответ на комментарий №2)
> > So what do we expect intead7
> "Scrolling" three last-arg history positions up, obviously.

Instead of improving/fixing insert-last-word (implemented in C source), upstream has been recommending the following commands:
    % autoload -Uz smart-insert-last-word
    % zle -N insert-last-word smart-insert-last-word
to be included in .zshrc.