djui / alias-tips

An oh-my-zsh plugin to help remembering those aliases you defined once
781 stars 51 forks source link

Preexec hook works correctly,but no output is printed #33

Open zgqq opened 7 years ago

zgqq commented 7 years ago
  echo $shell_functions "\n" $git_aliases "\n" $shell_aliases | \
    python ${_alias_tips__PLUGIN_DIR}/alias-tips.py $*

This echo doesn't print corresponding alias.

djui commented 7 years ago

I assume you did run with with the previous:

  shell_aliases=$(alias)

  shell_functions=$(functions | grep '^[a-zA-Z].\+ () {$')

  echo $shell_functions "\n" $git_aliases "\n" $shell_aliases | \
    python ${_alias_tips__PLUGIN_DIR}/alias-tips.py $*

? Still no output? Could you print echo $(alias) and echo $(functions | grep '^[a-zA-Z].\+ () {$')?

zgqq commented 7 years ago

@djui Thinks for rapid response, still no any output.I can print echo $(alias) and echo $(functions | grep '^[a-zA-Z].\+ () {$')

djui commented 7 years ago

Could you post the output here, stripping away any privacy related items?

cibinmathew commented 1 year ago

@djui

If I print below directly, I get 50+ aliases

```sh
❯ alias
50+ lines of output

I tried both shell_aliases=$(alias) and shell_aliases=$(\alias)

❯ echo $shell_aliases # prints only 2 lines
-='cd -'
..='%

alias for .. is ..='\cd ..', but in above output it is shown as ..='% if I do unalias .. and then run(It prints few more aliases than earlier). But it stops similarly at another line cd.='%. The real alias behind cd. is cd.='\cd ..'

cibinmathew commented 1 year ago

@zgqq In aliases like alias cdup='\cd ..', \c is interpreted differently