Skip to content

Fix for "Unknown command: hostname" error#12

Open
2meito wants to merge 1 commit into
oh-my-fish:masterfrom
2meito:master
Open

Fix for "Unknown command: hostname" error#12
2meito wants to merge 1 commit into
oh-my-fish:masterfrom
2meito:master

Conversation

@2meito

@2meito 2meito commented Jul 12, 2025

Copy link
Copy Markdown

When trying out the theme, every command would display the following error:

fish: Unknown command: hostname
~/.config/fish/functions/fish_prompt.fish (line 1): 
hostname|cut -d . -f 1
^~~~~~~^
in command substitution
	called on line 11 of file ~/.config/fish/functions/fish_prompt.fish
in function '__user_host'
	called on line 54 of file ~/.config/fish/functions/fish_prompt.fish
in function 'fish_prompt'
in command substitution
~/.config/fish/functions/fish_prompt.fish (line 11): Unknown command
  echo -n $USER@(hostname|cut -d . -f 1) (set color normal)
                ^~~~~~~~~~~~~~~~~~~~~~~^
in function '__user_host'
	called on line 54 of file ~/.config/fish/functions/fish_prompt.fish
in function 'fish_prompt'
in command substitution

Referencing other oh-my-fish themes, it seems the preferred way of getting the hostname is with uname -n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant