Code Monkey home page Code Monkey logo

Comments (17)

bluttringer avatar bluttringer commented on May 27, 2024 1

As @desyncr said, the problem is here: you must call rm like this: \rm to avoid asking confirmation when user has set an alias like rm=rm -i

from geometry.

frm avatar frm commented on May 27, 2024

Hi! Thanks for submitting the issue. Can you please tell us what OS and zsh version you are running?

from geometry.

ivancuric avatar ivancuric commented on May 27, 2024

macos 10.12.1 (16B2555), zsh 5.3 (x86_64-apple-darwin16.1.0)
Using zplug to manage the installation.

from geometry.

desyncr avatar desyncr commented on May 27, 2024

It's this line. I never got that message, it's write protected by any chance?

from geometry.

ivancuric avatar ivancuric commented on May 27, 2024

Yep, it's read-only for everyone but system.
Seems to be the following issue:
https://superuser.com/questions/1133065/unable-to-write-to-tmp-osx-unable-to-correct-permissions-operation-not-permitt#comment1629612_1133065

from geometry.

frm avatar frm commented on May 27, 2024

Try setting GEOMETRY_ASYNC_TMP_FILENAME=~/.geometry_rprompt_info before sourcing geometry.

from geometry.

ivancuric avatar ivancuric commented on May 27, 2024

The issue is still there.
This is my current .zshrc:

source ~/.zplug/init.zsh

# ZSH history
setopt append_history
setopt hist_expire_dups_first
setopt hist_fcntl_lock
setopt hist_ignore_all_dups
setopt hist_lex_words
setopt hist_reduce_blanks
setopt hist_save_no_dups
setopt share_history
setopt menu_complete
setopt COMPLETE_IN_WORD    # Complete from both ends of a word.
setopt ALWAYS_TO_END       # Move cursor to the end of a completed word.
setopt PATH_DIRS           # Perform path search even on command names with slashes.
setopt AUTO_MENU           # Show completion menu on a successive tab press.
setopt AUTO_LIST           # Automatically list choices on ambiguous completion.
setopt AUTO_PARAM_SLASH    # If completed parameter is a directory, add a trailing slash.
unsetopt MENU_COMPLETE     # Do not autoselect the first completion entry.
unsetopt FLOW_CONTROL      # Disable start/stop characters in shell editor.

setopt EXTENDED_GLOB
setopt NO_NOMATCH

GEOMETRY_ASYNC_TMP_FILENAME=~/.geometry_rprompt_info
GEOMETRY_PROMPT_PLUGINS=(virtualenv docker_machine exec_time git)


export PATH=/usr/local/bin:$PATH
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# For brew
export PATH="/usr/local/sbin:$PATH"
# For... something
export MANPATH="/usr/local/man:$MANPATH"
export PATH="$PATH:`yarn global bin`"

# Virtualenv
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh


precmd() {
if [[ -n $PYENV_SHELL ]]; then
  local version
  version=${(@)$(pyenv version)[1]}
  if [[ $version = system ]]; then
    PROMPT="%(?.%F{magenta}.%F{red})❯%f "
  else
    PROMPT="(pyenv $version) %(?.%F{magenta}.%F{red})❯%f "
  fi
fi
}

# Nvm
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"

export NODEDIR=$(which node)


export CLICOLOR=1
export TERM=xterm-256color
export BLOCK_SIZE=human-readable # https://www.gnu.org/software/coreutils/manual/html_node/Block-size.html
export HISTSIZE=11000
export SAVEHIST=10000
export HISTFILE=~/.zsh_history
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

# Supports oh-my-zsh plugins and the like
# zplug "zplug/zplug"
zplug "plugins/git", from:oh-my-zsh
zplug "mafredri/zsh-async"
# zplug "mreinhardt/sfz-prompt.zsh"
# zplug "sindresorhus/pure"
# zplug "marszall87/lambda-pure"
zplug "frmendes/geometry"
zplug "zsh-users/zsh-history-substring-search", nice:19
zplug "zsh-users/zsh-syntax-highlighting", nice:18
zplug "zsh-users/zsh-completions"


zstyle ':filter-select' max-lines 10
zstyle ':filter-select' extended-search yes
zstyle ':filter-select' case-insensitive yes
zstyle ':filter-select' rotate-list yes
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*' menu select
zstyle ':completion:*' menu select=20
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' verbose yes
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "${ZDOTDIR:-$HOME}/.zcompcache"
zstyle ':prezto:module:syntax-highlighting' highlighters \
'main' \
'brackets' \
'pattern' \
'line' \
'cursor' \
'root'

# ### KEY BINDINGS ###
KEYTIMEOUT=1 # Prevents key timeout lag.
bindkey -v

#
# Editors
#

export EDITOR='micro'
export PAGER='less'
# Set the default Less options.
# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
# Remove -X and -F (exit if the content fits on one screen) to enable it.
export LESS='-g -i -M -R -S -w -z-4'

# Set the Less input preprocessor.
# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system.
if (( $#commands[(i)lesspipe(|.sh)] )); then
export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
fi


# My stuff
source ~/.aliases
source ~/.functions

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

if ! zplug check --verbose; then
  printf "Install? [y/N]: "
  if read -q; then
    echo; zplug install
  fi
fi

zplug load

from geometry.

desyncr avatar desyncr commented on May 27, 2024

Not sure how zplug works but try moving

GEOMETRY_ASYNC_TMP_FILENAME=~/.geometry_rprompt_info
GEOMETRY_PROMPT_PLUGINS=(virtualenv docker_machine exec_time git)

Above the line where you source zplug.

from geometry.

ivancuric avatar ivancuric commented on May 27, 2024

Thanks, but it's not that either. I'll see what else I can dig up.

from geometry.

desyncr avatar desyncr commented on May 27, 2024

Try loading geometry without zplug. That would reduce the problem space.

from geometry.

ivancuric avatar ivancuric commented on May 27, 2024

Oh wow, it's the alias rm='rm -i -v'. However, I'm not sure I'm willing to give it up. Too much of a safety mechanism.

from geometry.

bluttringer avatar bluttringer commented on May 27, 2024

Sure, you don't have to remove it. The modification should be made in the async source code.

from geometry.

desyncr avatar desyncr commented on May 27, 2024

@bluttringer Good catch! Thank you.

from geometry.

desyncr avatar desyncr commented on May 27, 2024

Rather than fixing this particular case we should probably look at here.

from geometry.

bluttringer avatar bluttringer commented on May 27, 2024

Sure it sounds good to do unalias rather that make specific things but AFAIK the rm of the temp file is made for each display of the prompt right?
Would it not be too pricy to remove aliases then put them back at each prompt display?
Why having to remove the file? Maybe you could just use the same file that you would empty after use?

from geometry.

desyncr avatar desyncr commented on May 27, 2024

@bluttringer As I understand I have to remove/put back only once and not at every render cycle. I have to try it, to confirm.
If it's the case you describe yeah, it's a suboptimal solution and we'll look for other approach.

Why having to remove the file? Maybe you could just use the same file that you would empty after use?

Regarding why geometry deletes the file on every cycle the reason is because it uses the subprocess id to create the temp files, if we leave them around it'll create a bunch of them, not big deal but we'll like to keep it clean. If we use the same file, data from one terminal/tab will clutter the others.

May be we could use an ID per geometry/terminal instance.

from geometry.

frm avatar frm commented on May 27, 2024

Thanks for the help @bluttringer ! Feel free to submit a PR if you want to.

@desyncr am I wrong saying that the rm is going to happen everytime we need to kill the subprocess? It can be costly to do so.

Well, looking through the code how many instances of possible aliased commands are there? It would probably grep and rm just of the top of my head. Can't we do something like command or \rm on the commands that are going to be aliased most often? It's not a clean solution, but it's such a specific and unpredictable subject that it's probably better to do so than unaliasing and aliasing over and over. That's going to affect render time.

Alternatively we can't we use the actual process ID instead of the subprocess? Then, whenever geometry gets loaded we just do \rm of every file with the prefix.

from geometry.

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.