Skip to content
Advertisement

Tag: zsh

Pipe in ZSH is stripping colors from Git log output

I’m trying to utilize GRB’s git helpers (https://github.com/garybernhardt/dotfiles/blob/master/.githelpers) for pretty printing my git log. The git log –graph –pretty=”tformat:${LOG_FORMAT}” command from line #62 works just fine; printing with colors in iTerm. But as soon as it’s piped to pretty_git_format there are no colors displayed. This has been working for several years until just a few weeks ago. Was there a

Show all sourced files in ZSH

I want to see which files got sourced while starting the Z-shell. Does it even keep track and if yes is there a way to list all the files? Answer You could do a at the beginning of the very first file which gets sourced. See man zshoptions.

Exclude directory when grepping with zsh globbing

I have some file structure which contains projects with build folders at various depths. I’m trying to use zsh (extended) globbing to exclude files in build folders. I tried using the following command and many other variants: grep “string” (^build/)# I’m reading this as “Any folder that doesn’t match build 0 or more times.” However I’m still getting results from

command not found in zsh when it is there

I just installed the android SDK and was trying to run the emulator when this happened: emulator seems to be in one of the $PATH directories, but zsh still says that it wasn’t found. What could be the cause? Answer Solved it. The problem was that emulator was a 32-bit ELF binary, and I didn’t have the 32-bit runtime libraries

Are linux shell pipes pipelined?

Given a file input.txt if I do something like is the output from the first command continuously passed (as soon as it is generated) as input to the second command? Or does the pipe wait until the first command finishes to start running the second command? Answer Yes, they’re pipelined — each component’s stdout is connected to the stdin of

zsh option to generate the recomended options

There is a nice option when setting up zsh on Ubuntu However, on a fresh Arch Linux install the option is missing. Is there a way to have it (or maybe, I am being picky here) ? Answer This happens when you haven’t got a .zshrc and there’s a /etc/zsh/recommended.zshrc. If you say yes, it’ll just copy that one to

deactivate:unset:1: no such hash table element: pydoc

I am trying to setup my new laptop’s development environment. After install zsh I am constantly getting error deactivate:unset:1: no such hash table element: pydoc Please help. I have following simple aliases in my zshrc: Answer You can see virtualenv pr on github. or you can change deactivate () function. change unset -f pydoc to unset -f pydoc >/dev/null 2>&1

Parsing parameters with zparseopts, but from within a sourced script

I have a zsh script myscr.zsh, which sources another script zparse.zsh, like this: zparse.zsh expects a variable number of parameters, which do NOT need to be parsed using zparseopt, but zparse.zsh should – among other things – parse the positional parameters passed to mysrc.zsh. This is tricky, since mysrc.zsh has its own copy of $, which is different from the

Advertisement