Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Gauthier Castro
    @Chichilele
    @Andrea Hi, your code worked for me. Have a try with 'readlink -f' instead of 'dirname'.
    Andrea
    @Andrea
    my code works if I run it with bash my_filename.sh
    however I need to load this on the profile when zsh starts so it doesnt
    Gauthier Castro
    @Chichilele
    @Andrea Plus... this being a zsh forum using bash...?
    Andrea
    @Andrea
    well it is a shared script
    Gauthier Castro
    @Chichilele
    my code works if I run it with bash my_filename.sh well... haha
    Andrea
    @Andrea
    :D
    ie we use it in a team, so trying to find a way that will work for all
    Andrea
    @Andrea
    I tried a few options DIR="$( cd "$( readlink -f )" && pwd )" and DIR="$( cd "$( readlink -f "${BASH_SOURCE[0]}" )" && pwd )" and similar ones tho running sh my_file.sh gives erros on readlink
    Gauthier Castro
    @Chichilele
    Again, you are calling a bash variable !
    ?
    Andrea
    @Andrea
    nope, I get bad substitution
    usign ${(%):-%N}
    Gauthier Castro
    @Chichilele
    did you update the shbang ?:
    #!/bin/zsh echo "${(%):-%N}" DIR=$(readlink -f "${(%):-%N}") echo $DIR exit 0
    Andrea
    @Andrea
    yes, that worked
    what I am trying to find tho is something that works from a bash script in zsh, if that is not possible , knowing that it is not possible to get the current script directory from the same script but running on bash and zsh would be useful too
    Gauthier Castro
    @Chichilele
    it looks like you will have to make sure that you have the expected interpreter on the system you run the script. That's why the shebang is used for
    you may prefer to keep the #!/bin/bash which is more common
    if you know exactly what you are doing, and want to check user's DEFAULT interpreter (but maybe not current.......) you can use the "$SEHLL" variable
    Andrea
    @Andrea
    yes, that makes sense. Alternatively I could set that with en env setting, since this is so cumbersome (ie I would have to add different alternative for all popular shells)
    Konrad Papała
    @kpion
    Hi! I've just started with oh my zsh, so please forgive me my newbie question :) I'm trying to remove git support from it, so, according to the docs I removed it from the list of plugins in ~/.zshrc - but it doesn't work (I did restart my terminal). What I mean is the prompt, adding e.g. "git:(master)" everytime I'm in a dir under git. I don't want it...
    When googling I found two similar issues, but it seems like ppl are having problems with git-related aliases, so it's a bit different. Plus - I did not add/enable/change anything, I've just installed it, I have the default theme etc...
    Konrad Papała
    @kpion
    OK, nvm ,found it :) I'ts not about plugins, but themes, like the default one - robbyrussell.zsh-theme and the PROMPT='...$(git_prompt_info)' line. And learned a few things along the way :) BTW - Thanks for the great software!
    mohit munjani
    @Mmohhh_twitter

    I have this simple zshrc which displays time in prommpt and resets it every 1 second
    below is simplified version of my zshrc

    repeat_string(){
      # this works fine
      printf "-%.0s" $(seq 1 $(( $COLUMNS - 1)))
    
      # this doesn't works fine
      # printf "-%.0s" $(seq 1 $COLUMNS)
    }
    
    TMOUT=1
    
    TRAPALRM() {
      PROMPT="$(repeat_string)
      $(date)
      hello >>>"
      zle reset-prompt
    }

    I have simple function here repeat_string which I'm calling in my prompt string. purpose of this function is to display seperator (-) which has length equal to column width. It works fine when I pass repeat count which is not equal to $COLUMN. but if I pass $COLUMN, it behaves weird and truncates previous prompts and stdout also. Here is asciicinema link. https://asciinema.org/a/9FhIvtLD0XTnctEUXSRyZ9IrC

    Use following script to quickly reproduce issue

    mkdir /tmp/zshdebug
    cat <<'EOF' > /tmp/zshdebug/.zshrc
    repeat_string(){
      # this works fine
      printf "-%.0s" $(seq 1 $(( $COLUMNS - 1)))
    
      # this doesn't works fine
      # printf "-%.0s" $(seq 1 $COLUMNS)
    }
    
    TMOUT=1
    
    TRAPALRM() {
      PROMPT="$(repeat_string)
      $(date)
      hello >>>"
      zle reset-prompt
    }
    EOF
    ZDOTDIR=/tmp/zshdebug zsh

    zsh version: zsh 5.2 (x86_64-apple-darwin16.0)

    Peng QiBiao
    @AndreamApp
    jjjsjsj
    Corey Cole
    @CoreyCole
    Can anyone help me with string escaping? I have a script that runs as the root user when my server bootstraps. At the end of that script, I echo a line to the ubuntu user's ~/.zshrc file. My problem is that the colors codes in the string evaluate when the bootstrap script runs, but I need those colors to not be evaulated until the user logs in and the ~/.zshrc file is read. More detail here: https://stackoverflow.com/questions/52415887/installing-oh-my-zsh-for-a-different-user-as-root-in-cloud-init-script
    Corey Cole
    @CoreyCole
    I solved by using bash variables to postpone the evaluation of the colors/commands :D
    DI (FH) Johannes Neugschwentner
    @joehannes
    hello, somebody there?
    Erwan ROUSSEL
    @dimensi0n
    Hi ^^
    I created this thing: https://github.com/dimensi0n/readme
    It allows you to see git repositories README.md directly from the terminal.
    And I thought it can be a simple function in zsh so i recreated this and I putted the function in my .zshrc, it works :cool: So I wanted to know if somebody is interested about this functionnality, if yes I can add this to oh-my-zsh.
    Erwan ROUSSEL
    @dimensi0n
    Ok nobody is interested :cry:
    Stavros Kefaleas
    @skiabox
    hi
    SinaiHao
    @roachsinai
    Hi, does anyone met this problem robbyrussell/oh-my-zsh#7330
    SinaiHao
    @roachsinai
    :-(((
    Stavros Kefaleas
    @skiabox
    hello!
    Is there any way I can customise zsh-syntax-highlighting plugin?
    I get an underline when I type .. or ~
    Michael
    @g4m3rm1k3
    I made a developement group in Discord for people who are learning from all sorts of places https://discord.gg/FaP3g3P
    Damien O'Reilly
    @DamienOReilly
    Hi, if I have a command /shell script that is a wrapper around a command e.g. xgit for git, can I reuse the auto-completion got git with xgit easily without copying the auto-completition definitions?
    Jackson Delahunt
    @sabrehagen
    Hi All, is there a way turn on debug mode during install? #7492
    Aarmn the limitless
    @aarmn
    Hi there, Is there anything like /etc/bash.bashrc in zsh, sorry because my question is about zsh and not about oh-my-zsh, i don't found anything by search just oh-my-bash installations info came out of search. thanks in advance
    Simala Bounyavong
    @technix64
    /etc/zshenv
    /etc/zprofile
    /etc/zshrc
    /etc/zlogin
    /etc/zlogout
    These are the files that are invoked during startup, see: http://zsh.sourceforge.net/Doc/Release/Files.html
    Nadia
    @nadiaschutz
    hi guys
    Markus Vuorio
    @maakuth
    hi! my omz pulled upgrade today that seems to have borked it: /home/mvuorio/.oh-my-zsh/themes/robbyrussell.zsh-theme:3: command not found: ^M
    similar issues with git and ssh-agent plugins. disabling plugins and changing theme circumvents the issue, but something seems to be up
    Markus Vuorio
    @maakuth
    oh, it's zsh on wsl by the way