sachaos / viddy

👀 A modern watch command. Time machine and pager etc.
MIT License
4.8k stars 94 forks source link

Viddy should check for `~/.bash_profile`/`~/*.shell*_profile` as well as `~/.profile` #164

Open excited-bore opened 1 week ago

excited-bore commented 1 week ago

As referenced by sachaos https://github.com/sachaos/viddy/issues/2#issuecomment-904002053, aliases need to be referenced in ~/.profile before viddy acknowledges them, but the thing is that certain aliases are shell-type specific.

Also alias in bash and zsh are differently build (alias in zsh has options and stuff)

sachaos commented 9 hours ago

@excited-bore Thank you! Are those profile not loaded by specifying --login option?

excited-bore commented 8 hours ago
(in `~/.bash_aliases.d/general.sh`, wich is sourced in `~/.bash_aliases`, which in turn is sourced in `~/.bash_profile`) 
alias ls="eza --header --color=always --icons"

After a reboot:

$ viddy --shell '/bin/bash' --shell-options "--login" ls
viddy error: Something went wrong
Error: 
   0: No command provided

EDIT: I added [ -f ~/.bash_aliases.d/general.sh ] && source ~/.bash_aliases.d/general.sh to ~/.bash_profile and it still resulted in the same error. Works great when i source it in ~/.profile