PatTheMav / minimal2

Adaption of subnixr's minimal zsh theme for zimfw
GNU General Public License v3.0
12 stars 2 forks source link

Showing prompt help command before showing the actual shell prompt #2

Closed rezmuh closed 5 years ago

rezmuh commented 5 years ago

Hi, I just came across this repo because i wanted to use minimal prompt with zimfw. I loaded minimal2 inside zmodule and used minimal2 as the theme. However, I got the following:

Screen Shot 2019-08-10 at 00 19 41
PatTheMav commented 5 years ago

That looks more like it's being triggered by a malformed prompt command somewhere...

I take it you don't use the develop branch of zimfw? Also might be important to see how/where you added the module to the zmodules setting.

rezmuh commented 5 years ago

Hey @PatTheMav, I am using master branch on commit b180b40

This is what I have in .zimrc:

zmodules=(directory environment git git-info history input utility custom \
          minimal2 prompt completion syntax-highlighting history-substring-search )
zprompt_theme='minimal2'
rezmuh commented 5 years ago

Also, when I press enter, I got the following:

Screen Shot 2019-08-10 at 15 50 34
PatTheMav commented 5 years ago

Alright, so what's happening here is that the current version of the prompt theme is executed by default, as it's not dependent on promptinit (zimfw develop branch doesn't use it anymore).

So the code is automatically executed, the prompt theme is installed, and by specifying minimal2 as the zprompt_theme, no built-in prompt is activated (instead the promptinit help is shown, as minimal2 is no valid choice).

What you can do for now to fix this is:

  1. Create a folder called functions inside the minimal2 module folder
  2. Delete the symlink prompt_minimal2_setup
  3. Create a new symlink in the functions subfolder: cd functions; ln -s ../minimal2.zsh-theme prompt_minimal2_setup; cd ..
  4. Restart your zsh

The theme should now be properly installed. I will have to think about how to support both the current master branch as well as the develop branch. Maybe just telling people to disable the prompt submodule might help, but the above steps should help for now.


As for the second issue, I have no idea what throws the Unknown argument errors there, but the above steps seemed to suffice in my checks.

rezmuh commented 5 years ago

Alright, so what's happening here is that the current version of the prompt theme is executed by default, as it's not dependent on promptinit (zimfw develop branch doesn't use it anymore).

So the code is automatically executed, the prompt theme is installed, and by specifying minimal2 as the zprompt_theme, no built-in prompt is activated (instead the promptinit help is shown, as minimal2 is no valid choice).

What you can do for now to fix this is:

  1. Create a folder called functions inside the minimal2 module folder
  2. Delete the symlink prompt_minimal2_setup
  3. Create a new symlink in the functions subfolder: cd functions; ln -s ../minimal2.zsh-theme prompt_minimal2_setup; cd ..
  4. Restart your zsh

Thanks for this. You're right. Moving the symlink to functions did the job. Thanks for the explanation as well.

The theme should now be properly installed. I will have to think about how to support both the current master branch as well as the develop branch. Maybe just telling people to disable the prompt submodule might help, but the above steps should help for now.

As for the second issue, I have no idea what throws the Unknown argument errors there, but the above steps seemed to suffice in my checks.

I found out the issue. It was caused by exa. I aliased ls to exa. So I just specified /bin/ls instead of ls in minimal2.zsh-theme