Tag Info

New answers tagged

2

Bart Schaefer proposed the following approach to the same question on the zsh users mailing list: zshaddhistory() { whence ${${(z)1}[1]} >| /dev/null || return 1 } This function is executed before the command line is written to history. If it does return 1, the current command line is neither appended to the history file nor to the local history ...


-2

not sure how omz runs it but in both bash and regular zsh prefixing with a space keeps it out of .history and henceforth also out of auto complete/suggest i.e. <space>ll -ahZ /home/%USER


0

.zshrc-e means zshrc e(xample) file.


1

You need to enable the AUTO_NAME_DIRS option in your Zsh configuration setopt autonamedirs it has to happen before you set PROJ. Alternatively, if you do not need PROJ for anything other than switching (and displaying) paths in Zsh, you can set hash -d PROJ=$HOME/project Explanation: The feature you are using is called "Static named directories". ...


0

A cleaner way that will also protect your system in case your custom shell is blown up is to create a .profile in root's home directory w/: if [ -x /opt/local/bin/bash ]; then SHELL=/opt/local/bin/bash export SHELL exec /opt/local/bin/bash else echo /opt/local/bin/bash not found using default shell of $SHELL fi Just change the path to the ...


1

It isn't true that alias is used only to navigate folders. It can be used for other commands as well (that's why it's called alias). In example: alias arestart='sudo apachectl restart' alias alog='tail -f /var/log/apache2/error_log' and place them in ~/.bashrc or ~/.bash_profile. Or you may want to put all your alias definitions into a separate file ...


1

The clean solution was given by @Adaephon's answer, which I definitively recommend. However, I want to give you the cause of your troubles, too: The problems are resulting because zsh counts the escape codes to the length of the prompt. This is wrong, because these codes are processed by the terminal emulator and are not displayed and results in the offset ...


2

It seems that the ANSI codes are messing with your terminal, possibly due to some interactions with the other contents of PS1 or because you do not reset to default. Luckily, in zsh there is no need to use ANSI escape codes. You can use %F{color} and %K{color} to set foreground and background colors respectively and %f and %k to reset default values (See ...



Top 50 recent answers are included