Giter Club home page Giter Club logo

Comments (13)

tekhnee avatar tekhnee commented on July 4, 2024 1

@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.

tekhnee avatar tekhnee commented on July 4, 2024 1

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.

marlonrichert avatar marlonrichert commented on July 4, 2024 1

Thanks for the info! I’ll have a look at what could be the problem.

from zsh-hist.

marlonrichert avatar marlonrichert commented on July 4, 2024 1

And yes indeed, setopt extendedglob does the trick — thank you! Is this option required by zsh-hist?

No, it just means I need to set it inside the function. 🙂

from zsh-hist.

marlonrichert avatar marlonrichert commented on July 4, 2024 1

Should be fixed now.

from zsh-hist.

marlonrichert avatar marlonrichert commented on July 4, 2024

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.

marlonrichert avatar marlonrichert commented on July 4, 2024

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.

tekhnee avatar tekhnee commented on July 4, 2024

@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.

marlonrichert avatar marlonrichert commented on July 4, 2024

Can you please do functions -T .hist.format, try again and paste the debug out here?

from zsh-hist.

tekhnee avatar tekhnee commented on July 4, 2024

@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.

tekhnee avatar tekhnee commented on July 4, 2024

UPDATE: I migrated my zsh from zplug to zsh-snap. It was worth every minute, but this particular issue persists.

from zsh-hist.

marlonrichert avatar marlonrichert commented on July 4, 2024

@tekhnee If you do setopt extendedglob and then try again, does the problem go away?

from zsh-hist.

tekhnee avatar tekhnee commented on July 4, 2024

@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 (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.