Starship cannot handle hostnames with a "-" in them

I’ve installed Garuda on multiple pc’s…a couple of which have hyphens in the name…for example XPS-7300 and HP 810-135qe

Starship will truncate the prompt to famewolf@XPS or famewolf @HP 810. Using hostnamectl to remove the hyphen works around the issue but I was wondering if anyone knew of a better solution.

System:
  Kernel: 6.10.10-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=5ad7fecd-1a14-4590-8ce1-42685c5ee6c8 rw rootflags=subvol=@
    quiet rd.luks.uuid=2bdec0d6-999c-4a5a-9278-70a5c8e236d9 loglevel=3
    ibt=off
  Desktop: KDE Plasma v: 6.1.5 tk: Qt v: N/A info: frameworks v: 6.6.0
    wm: kwin_wayland with: krunner vt: 1 dm: SDDM Distro: Garuda
    base: Arch Linux
Machine:
  Type: Desktop Mobo: N/A model: N/A serial: <superuser required>
    uuid: <superuser required> UEFI: American Megatrends LLC. v: AM08Pro_P5C5V19
    date: 09/20/2023
Battery:
  Device-1: hidpp_battery_51 model: Logitech M570 serial: <filter> charge: 20%
    rechargeable: yes status: discharging
CPU:
  Info: model: AMD Ryzen 7 7735HS with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3+ gen: 3 level: v3 note: check built: 2022 process: TSMC n6 (7nm)
    family: 0x19 (25) model-id: 0x44 (68) stepping: 1 microcode: 0xA404102
  Topology: cpus: 1x dies: 1 clusters: 1 cores: 8 threads: 16 tpc: 2
    smt: enabled cache: L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB
    desc: 8x512 KiB L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 1426 min/max: 400/4829 scaling: driver: amd-pstate-epp
    governor: powersave cores: 1: 1426 2: 1426 3: 1426 4: 1426 5: 1426 6: 1426
    7: 1426 8: 1426 9: 1426 10: 1426 11: 1426 12: 1426 13: 1426 14: 1426
    15: 1426 16: 1426 bogomips: 102206
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Rembrandt [Radeon 680M]
    driver: amdgpu v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm)
    built: 2020-22 pcie: gen: 4 speed: 16 GT/s lanes: 16 ports:
    active: HDMI-A-1 empty: DP-1, DP-2, DP-3, DP-4, DP-5, HDMI-A-2,
    Writeback-1 bus-ID: e5:00.0 chip-ID: 1002:1681 class-ID: 0300 temp: 54.0 C
  Device-2: Sunplus Innovation Full HD webcam driver: snd-usb-audio,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-1.1.4.2:85
    chip-ID: 1bcf:2284 class-ID: 0102 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
    compositor: kwin_wayland driver: X: loaded: amdgpu unloaded: modesetting
    alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: 0
  Monitor-1: HDMI-A-1 res: 2752x1152 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi
    wayland: drv: radeonsi x11: drv: radeonsi
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.2.4-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon 680M (radeonsi rembrandt
    LLVM 18.1.8 DRM 3.57 6.10.10-zen1-1-zen) device-ID: 1002:1681
    memory: 3.91 GiB unified: no display-ID: :1.0
  API: Vulkan v: 1.3.295 layers: 3 device: 0 type: integrated-gpu name: AMD
    Radeon 680M (RADV REMBRANDT) driver: mesa radv v: 24.2.4-arch1.1
    device-ID: 1002:1681 surfaces: xcb,xlib,wayland device: 1 type: cpu
    name: llvmpipe (LLVM 18.1.8 256 bits) driver: mesa llvmpipe
    v: 24.2.4-arch1.1 (LLVM 18.1.8) device-ID: 10005:0000
    surfaces: xcb,xlib,wayland
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Rembrandt Radeon High Definition
    Audio driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s
    lanes: 16 bus-ID: e5:00.1 chip-ID: 1002:1640 class-ID: 0403
  Device-2: Advanced Micro Devices [AMD] ACP/ACP3X/ACP6x Audio Coprocessor
    driver: snd_pci_acp6x v: kernel alternate: snd_pci_acp3x, snd_rn_pci_acp3x,
    snd_pci_acp5x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
    snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh,
    snd_sof_amd_acp63 pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: e5:00.5
    chip-ID: 1022:15e2 class-ID: 0480
  Device-3: Advanced Micro Devices [AMD] Family 17h/19h HD Audio
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: e5:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Device-4: Sunplus Innovation Full HD webcam driver: snd-usb-audio,uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-1.1.4.2:85
    chip-ID: 1bcf:2284 class-ID: 0102 serial: <filter>
  API: ALSA v: k6.10.10-zen1-1-zen status: kernel-api tools: N/A
  Server-1: PipeWire v: 1.2.5 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8125 2.5GbE driver: r8169 v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 port: f000 bus-ID: 02:00.0 chip-ID: 10ec:8125
    class-ID: 0200
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Realtek RTL8852BE PCIe 802.11ax Wireless Network
    driver: rtw89_8852be v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: e000 bus-ID: 03:00.0 chip-ID: 10ec:b852 class-ID: 0280
  IF: wlp3s0 state: down mac: <filter>
  Info: services: NetworkManager, smbd, sshd, systemd-timesyncd,
    wpa_supplicant
Bluetooth:
  Device-1: Realtek Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-3:3 chip-ID: 0bda:b85b
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 22 state: up address: <filter> bt-v: 5.2
    lmp-v: 11 status: discoverable: no pairing: no class-ID: 6c0104
Drives:
  Local Storage: total: 2.33 TiB used: 21.49 GiB (0.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Intel model: SSDPEKNU020TZ
    size: 1.86 TiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 003C temp: 46.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: MZALQ512HALU-000L2
    size: 476.94 GiB block-size: physical: 512 B logical: 512 B type: USB
    rev: 2.1 spd: 480 Mb/s lanes: 1 mode: 2.0 tech: N/A serial: <filter>
    fw-rev: 1.00 scheme: MBR
Partition:
  ID-1: / raw-size: 1.86 TiB size: 1.86 TiB (100.00%) used: 21.48 GiB (1.1%)
    fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-2bdec0d6-999c-4a5a-9278-70a5c8e236d9
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 728 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 1.86 TiB size: 1.86 TiB (100.00%)
    used: 21.48 GiB (1.1%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-2bdec0d6-999c-4a5a-9278-70a5c8e236d9
  ID-4: /var/log raw-size: 1.86 TiB size: 1.86 TiB (100.00%)
    used: 21.48 GiB (1.1%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-2bdec0d6-999c-4a5a-9278-70a5c8e236d9
  ID-5: /var/tmp raw-size: 1.86 TiB size: 1.86 TiB (100.00%)
    used: 21.48 GiB (1.1%) fs: btrfs dev: /dev/dm-0 maj-min: 254:0
    mapped: luks-2bdec0d6-999c-4a5a-9278-70a5c8e236d9
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 27.15 GiB used: 1022.8 MiB (3.7%)
    priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 16
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 60.5 C mobo: N/A gpu: amdgpu temp: 55.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 28 GiB available: 27.15 GiB used: 13.14 GiB (48.4%)
  Processes: 439 Power: uptime: 7d 15h 36m states: freeze,mem,disk
    suspend: s2idle wakeups: 21 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 10.85 GiB services: org_kde_powerdevil,
    power-profiles-daemon, upowerd Init: systemd v: 256 default: graphical
    tool: systemctl
  Packages: pm: pacman pkgs: 1515 libs: 397 tools: octopi,paru pm: appimage
    pkgs: 0 Compilers: gcc: 14.2.1 Shell: garuda-inxi default: fish v: 3.7.1
    running-in: yakuake inxi: 3.3.36
Garuda (2.6.26-1):
  System install date:     2024-09-26
  Last full system update: 2024-10-07 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            archlinux-keyring-wkd-sync.service configure-printer@usb-003-015.service configure-printer@usb-003-017.service configure-printer@usb-003-018.service configure-printer@usb-003-026.service configure-printer@usb-003-027.service configure-printer@usb-003-063.service configure-printer@usb-003-066.service configure-printer@usb-003-076.service 

I question this being listed as “unsupported software” when garuda exclusively seems to be using starship to generate the user prompt in the fish shell. This is not being used elsewhere from what I can tell and the configuration has to be garuda specific I would think?

Interestingly this has been a thing since I started using starship. I never questioned it :grinning: might open an issue at starships issue tracker?

3 Likes

In this context, this means that this is not a piece of software we develop (nor customize locally), so there is nothing we can do about it, if it is a bug.
For sure, when it is something handled or that could be handled via the config files we provide, we have to act. But this doesn’t seem to be the case.

3 Likes

Check your

~/.config/starship.toml

That should look similar to this

And try commenting the

trim_at = "-"
5 Likes

Hah, this explains why I didn’t find any issue about it. Didn’t have a look at the config yet. Let’s make this a default? :blush:

I’m only on my mobile and couldn’t test it :grinning:
Let’s wait for the feedback of the OP.
After all, in general, this could be useful to keep the prompt short (I guess…).

2 Likes

That resolved the issue.

Screenshot_20241008_131203

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.