The hostname module doesn't treat the values of hostname.prefix and hostname.suffix in starship.toml as an actual prefix and suffix. Instead, it wraps them into the main hostname value and then forces a prefix of "on " before that value, as below:
module.set_style(config.style);
let hostname_stacked = format!("{}{}{}", config.prefix, host, config.suffix);
module.create_segment("hostname", &SegmentConfig::new(&hostname_stacked));
module.get_prefix().set_value("on ");
The values of hostname.prefix and hostname.suffix as set by the user replace the defaults, and appear with the same formatting (i.e. unformatted) as the default "on " prefix. In other words, the following starship.toml...
[hostname]
prefix = "@ "
...and the hostname Foo would result in the hostname module printing...
@ Foo
...rather than the default:
on Foo
Environment and shell configuration trimmed, as the cause seems to be a directly apparent design choice in the code - I can add them again if needed, though
This should be fixed by #1071 and the switch to use format strings.
Still an issue on the latest starship?
Still an issue on the latest starship?
For now yes but this will be resolved as part of the v0.45.0 release.
Since we are getting close to the v0.45.0 release, I'm going to close this issue so we can see what is actually left to do in the milestone and what still needs a little bit of work.
Most helpful comment
This should be fixed by #1071 and the switch to use format strings.