Comments (13)
@marlonrichert thank you for these troubleshooting steps.
Indeed, sourcing the plugin within a pristine shell suppresses the issue.
I'll try to identify the conflicting plugin—if I understand your intention correctly—and report back.
from zsh-hist.
UPDATE: The issue persists with the following bare-bones .zshrc
:
export ZPLUG_HOME=~/.zplug
source $ZPLUG_HOME/init.zsh
zplug "marlonrichert/zsh-hist"
zplug load
In tandem with your troubleshooting steps above, this suggests that a conflict between zplug and zsh-hist is likely.
(Have been troubleshooting with both iTerm2 and Terminal.app on a Mac.)
from zsh-hist.
Thanks for the info! I’ll have a look at what could be the problem.
from zsh-hist.
And yes indeed,
setopt extendedglob
does the trick — thank you! Is this option required byzsh-hist
?
No, it just means I need to set it inside the function. 🙂
from zsh-hist.
Should be fixed now.
from zsh-hist.
Every command line? That’s weird. Can you please try the following?
$ cd $(mktemp -d) # Create a temp dir and enter it.
$ ZDOTDIR=$PWD HOME=$PWD zsh -f # Start a subshell in it without config files.
% source path/to/zsh-hist.plugin.zsh # Source the plugin.
% # Insert here the steps you take to reproduce your bug.
Does the problem occur then, too?
from zsh-hist.
Sorry, but I cannot reproduce this. Here's what I did:
> brew install zplug
> cd "$(mktemp -d)"
> ZDOTDIR=$PWD HOME=$PWD PS1='%~:%?> ' PS4='+%e %N:%I %?> %_ ' zsh -f
% export ZPLUG_HOME=/usr/local/opt/zplug
% source $ZPLUG_HOME/init.zsh
% zplug "marlonrichert/zsh-hist"
% zplug load
And then I tried out different kinds of commands. They all work correctly for me.
from zsh-hist.
@marlonrichert hmm… I'm not surprised. The issue is profoundly puzzling. Removing zsh-hist from my plugins list instantly fixes it. (Of course this doesn't prove that zsh-hist is responsible for it!)
Deliberately prefixing a command with N tab characters (N > 1), it is still stored in the history with exactly one tab character. So the bug does not add a tab character before each command line; it rather "massages" the command line with a single-tab prefix—just as one would go about indenting a line. This is why I hypothesized, for a moment, that HIST_REDUCE_BLANKS
might be to blame; but no…
Any further thoughts would be much appreciated, though I realize that this might be specific to my setup.
from zsh-hist.
Can you please do functions -T .hist.format
, try again and paste the debug out here?
from zsh-hist.
@marlonrichert here you go (testing with a plain ls
command at the prompt). I can see several suspects… Your expertise is much appreciated.
ls+.hist.format:1> setopt localoptions
+.hist.format:2> zstyle -t :hist: expand-aliases
+.hist.format:5> setopt NO_aliases
+.hist.format:7> REPLY=ls
+.hist.format:8> local -i ret=1
+.hist.format:10> functions[.tmp.]=ls
+.hist.format:11> [[ -n $'\tls' ]]
+.hist.format:12> REPLY='' ft+Tab to insert)
+.hist.format:13> local word chunk body=$'\n\tls'
+.hist.format:14> word=ls
+.hist.format:15> chunk=$'\n\tls'
+.hist.format:16> body=''
+.hist.format:17> prefix=$'\n\t'
+.hist.format:18> indent=''
+.hist.format:19> REPLY+=$'\n\tls'
+.hist.format:21> REPLY=$'\tls'
+.hist.format:22> ret=0
+.hist.format:25> [[ -v 'functions[.tmp.]' ]]
+.hist.format:26> unfunction .tmp.
+.hist.format:28> return ret
ls
./
../
<…etc.>
from zsh-hist.
UPDATE: I migrated my zsh
from zplug
to zsh-snap
. It was worth every minute, but this particular issue persists.
from zsh-hist.
@tekhnee If you do setopt extendedglob
and then try again, does the problem go away?
from zsh-hist.
@marlonrichert I meant to say that migrating was *worth every minute.
And yes indeed, setopt extendedglob
does the trick — thank you! Is this option required by zsh-hist
?
from zsh-hist.
Related Issues (18)
- Commands drawn from history cannot be executed. HOT 3
- Problems with unicode characters HOT 3
- Select multiple history entries HOT 3
- How to do a big-time auto format in place?
- TODO: Add installation instructions
- Regex `\b` replaced with `^H` in multi-line command HOT 2
- Don't add current command to history (`ignore` flag) HOT 2
- Plugin no longer working as expected after recent changes HOT 5
- Make plugin work with per-directory-history too, not just global history HOT 2
- ^Q unavailable in vi command mode
- hist: warning: $HISTSIZE should be at least 20% larger than $SAVEHIST HOT 1
- The term "undo" is used twice HOT 4
- Widgets are not found anymore HOT 4
- Aliases are automatically expanded before the command is executed HOT 16
- Code formatting ignores HIST_IGNORE_SPACE HOT 3
- History line autocompletion not working. HOT 1
- History line tab-completion not working. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zsh-hist.