#[SOLVED] Zsh theme question

24 messages · Page 1 of 1 (latest)

swift fossil
#

I've been trying to set up a theme for zsh today, and all of the stock themes (except for the default theme) come with the line "prompt_promptnamesetup "$@"" at the end. It took forever to find out that $@ wasn't a zsh term, but a POSIX theme, and now I know that $@ is a parameter that includes all of the arguments of a command in the form of an array, but I don't know what it's doing here. Is it saying that when promptpromptnamesetup is entered into the command line it will enter the previously defined promptpromptname_setup followed by the array of all the arguments used in the shell?? My brain is so fried, the documentation on this is so in depth, but also SO hard to read

Edit: oh discord hates what I did with italics. oh well

real kiln
#

@swift fossil link your zsh config please

swift fossil
real kiln
swift fossil
swift fossil
real kiln
#

is that all?

swift fossil
#

yeah, I haven't messed with the config proper much yet

real kiln
swift fossil
# real kiln is oh my zsh installed?

No, I haven't looked into it enough yet. Idk why Id get it yet. Saw it has some kitty integration so that's cool, but I'm not gonna install something until I know why I'm getting it

real kiln
swift fossil
real kiln
swift fossil
#

I don't know what I want my theme to look like yet, I think I was pretty clear in my original post. I want to know what the line at the end of the theme file that says 'prompt_(promptname)_setup "$@"' does

real kiln
#

[USERNAME]@[HOSTNAME]:[PATH][SYMBOL]

#

[USERNAME] is the username of the currently operating user. normally this is your user, but when you run sudo su or similar commands, you get a "root shell", that means the user is "root".

#

[HOSTNAME] is your hostname. It's the name of your computer. You had to enter that during the system installation.

#

[PATH] is your current working directory, the directory you're currently operating on. When you open a new terminal, the default directory is your current user's home directory. A synonym for /home/YOURUSERNAME is ~.

#

[SYMBOL] is usually either $ if you're operating as any normal user, or # if you're operating as "root" user.

swift fossil
#

... this is not an answer... I already know what all of those things are; I want to know what it's doing calling the positional array... I don't know if I need that until I know what it does.

#

the default zsh theme doesn't have it, but all the others do. That makes me think that it's helpful considering every other theme includes it, but I don't know what the purpose is yet

swift fossil
#

Had my question answered elsewhere :D

The line
prompt_promptname_setup "$@"
Makes the command
prompt promptname -arg1 -arg2
Resolve the previously defined
prompt_promptname_set
Resolve as
prompt_promptname_set -arg1 -arg2
And those arguments can interact with the theme as you define them to