8000 sample fish prompts call `hostname` too often · Issue #3480 · fish-shell/fish-shell · GitHub
[go: up one dir, main page]

Skip to content

sample fish prompts call hostname too often #3480

@krader1961

Description

@krader1961

Some of the sample fish prompts (in share/tools/web_config) run hostname every time the prompt is displayed. That command can be slow if, for example, there is a problem with DNS. All of the prompts should use this pattern:

# Just calculate this once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
        set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end

That's from share/functions/fish_prompt.fish. Obviously we can now do it slightly faster using the string builtin.

This issue was triggered by issue #3479.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0