Closed sirfoga closed 5 years ago
So indeed it seems that fc -lnr -0
does not work on zsh. But using -1
is not right either, because it gives the last command, not the one that is about to be executed.
It seems the behavior differs from Bash to Zsh: https://stackoverflow.com/questions/25295186/access-to-last-command-in-zsh-not-previous-command-line
A solution could be to use echo $history[$HISTCMD]
instead of the fc
command. I'm gonna run some tests and report back :slightly_smiling_face:
I think I have a working solution now. Could you discard your PR #21 as it contains fixes for two issues? I'm gonna open a new one to fix issue #20, so you can review it if you like.
You can also re-open a new PR containing just the fix for #22 (which I think will need just one or two small changes :slightly_smiling_face:)
yess, I've tried it (briefly) and it actually seems to be working :)
Solved by #23!
my system
$ uname -a
Linux novo 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux$ zsh --version
zsh 5.4.2 (x86_64-ubuntu-linux-gnu)my problem
when I open a shell (e.g gnome-terminal) 3 errors appear:
I can keep using my shell, but no command data is logged.
solution
fc
command in line 15 of shellhistory.sh to... -lnr -1 ...
fc
command in line 19 of shellhistory.sh to... -lnr -1 ...
my solution
this PR
the question
why does
fc
not work with arg-0
? Is there a problem with my shell setup?@pawamoy thanks for your work