alias-tips icon indicating copy to clipboard operation
alias-tips copied to clipboard

Preexec hook works correctly,but no output is printed

Open zgqq opened this issue 7 years ago • 5 comments

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

This echo doesn't print corresponding alias.

zgqq avatar May 29 '17 06:05 zgqq

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].\+ () {$')?

djui avatar May 29 '17 06:05 djui

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

zgqq avatar May 29 '17 07:05 zgqq

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

djui avatar May 29 '17 17:05 djui

@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 avatar Apr 16 '23 12:04 cibinmathew

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

cibinmathew avatar Apr 16 '23 15:04 cibinmathew