Code Monkey home page Code Monkey logo

Comments (9)

junegunn avatar junegunn commented on May 22, 2024

Hmm, I can't reproduce the problem. Tested it on zsh 5.0.2 (x86_64-apple-darwin13.0)
FYI, my .zshrc is empty as I don't use zsh.

from fzf.

jebaum avatar jebaum commented on May 22, 2024

Woops, my mistake, it only occurs when using oh-my-zsh. I'm gonna try to figure out exactly what it is, obviously not the fault of your script. Sorry for the false issue

from fzf.

jebaum avatar jebaum commented on May 22, 2024

For the record, this function that's in a file getting sourced is causing the problem:

function title {
if [[ "$DISABLE_AUTO_TITLE" == "true" ]] || [[ "$EMACS" == term ]]; then
return
fi
if [[ "$TERM" == screen* ]]; then
print -Pn "\ek$1:q\e" #set screen hardstatus, usually truncated at 20 chars
elif [[ "$TERM" == xterm* ]] || [[ $TERM == rxvt* ]] || [[ $TERM == ansi ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
print -Pn "\e]2;$2:q\a" #set window name
print -Pn "\e]1;$1:q\a" #set icon (=tab) name (will override window name on broken terminal)
fi
}

Specifically the print -Pn "\e]2;$2:q\a" line. I have no idea why

from fzf.

junegunn avatar junegunn commented on May 22, 2024

No problem. Please let me know if you find out the cause, maybe I could mention it in the README page. Thanks.

from fzf.

junegunn avatar junegunn commented on May 22, 2024

Oh, thanks. Did you find a workaround? I'll try to look into it, but I'm completely ignorant on zsh or oh-my-zsh.

from fzf.

junegunn avatar junegunn commented on May 22, 2024

Did you use backticks to execute fzf?

I can see the problem you mentioned when I use backticks as follows.

vim `fzf`

However, the following works fine.

vim $(fzf)

from fzf.

jebaum avatar jebaum commented on May 22, 2024

Yep, I was using backticks and it works fine with $(), thanks!
Do you happen to know why? I can't find any documentation on the difference between the two

from fzf.

junegunn avatar junegunn commented on May 22, 2024

Honestly I have no idea at all.
I've never used zsh/oh-my-zsh seriously before and trying with $() instead of backticks was just a lucky guess.
As far as I know, at least on bash, $() and backticks are equivalent except that $() can be nested,
and I don't think it should be any different on zsh.
I guess it's a bug of oh-my-zsh, but I'm not sure if I'm going to look into it since I myself don't use it.

from fzf.

lbolla avatar lbolla commented on May 22, 2024

I was happening to me too, before I removed the preexec hook:

# preexec is called just before any command line is executed
# Note: breaks fzf piping
# function preexec() {
#     title "$1" "%m:%35<...<%~"
# }

No idea why.

from fzf.

Related Issues (20)

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.