Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Windows drive root directory is missing backslash #4226

Closed
AbraxasDMG opened this issue Aug 3, 2022 · 5 comments
Closed

On Windows drive root directory is missing backslash #4226

AbraxasDMG opened this issue Aug 3, 2022 · 5 comments
Labels
🐛 bug Something isn't working as expected.

Comments

@AbraxasDMG
Copy link

First and foremost, a big thanks for this nice piece of software. :)

Current Behavior

I'd like to emulate the look and feel of command prompt or powershell, when it comes to the prompt format. To have a full untruncated path in a single line with the command I am typing. In my case, I also would like not to have any modules reporting on things (like php, nodejs, etc. adding "via <module symbol>" to the prompt).
Something like:
C:\Users\john> dir *.*

I have managed to achieve that configuration with one exception.
When the current directory is a root directory of any Windows drive (C:\, D:\, etc.), there's a missing backslash '\', so instead of C:\> I get C:>.

Without going into too much debate on the theory of MS OS (Windows, DOS, etc.), I think that it would be correct to always display trailing backslash, even when modules are used (and they add "via ". C: is the drive identifier. The root directory on that drive is C:\, therefore, the backslash should not be optional.

Environment

  • Starship version: 1.9.1
  • pwsh version: PowerShell 7.2.5
  • Operating system: Windows 10.0.19044
  • Terminal emulator:
  • Git Commit Hash: 4e9b840
  • Branch/Tag: master
  • Rust Version: rustc 1.61.0 (fe5b13d68 2022-05-18)
  • Rust channel: stable-x86_64-pc-windows-msvc release
  • Build Time: 2022-06-27 19:14:16 +00:00

Relevant Shell Configuration

<unknown config>

Starship Configuration

# Warning: This config does not include keys that have an unset value

# $all is shorthand for $username$hostname$localip$shlvl$singularity$kubernetes$directory$vcsh$git_branch$git_commit$git_state$git_metrics$git_status$hg_branch$docker_context$package$c$cmake$cobol$daml$dart$deno$dotnet$elixir$elm$erlang$golang$haskell$helm$java$julia$kotlin$lua$nim$nodejs$ocaml$perl$php$pulumi$purescript$python$raku$rlang$red$ruby$rust$scala$swift$terraform$vlang$vagrant$zig$buf$nix_shell$conda$spack$memory_usage$aws$gcloud$openstack$azure$env_var$crystal$custom$sudo$cmd_duration$line_break$jobs$battery$time$status$container$shell$character
"$schema" = 'https://starship.rs/config-schema.json'
format = '$all'
right_format = ''
continuation_prompt = '[∙](bright-black) '
scan_timeout = 30
command_timeout = 500
add_newline = false
php.disabled=true
line_break.disabled = true

[character]
format = '$symbol '
success_symbol = '[❯](bold green)'
error_symbol = '[❯](bold red)'
vimcmd_symbol = '[❮](bold green)'
vimcmd_visual_symbol = '[❮](bold yellow)'
vimcmd_replace_symbol = '[❮](bold purple)'
vimcmd_replace_one_symbol = '[❮](bold purple)'
disabled = false

[directory]
truncation_length = 100
truncate_to_repo = false
format = '[$path]($style) '
style = 'cyan bold'
disabled = false
home_symbol = '~'
use_os_path_sep = true
@AbraxasDMG AbraxasDMG added the 🐛 bug Something isn't working as expected. label Aug 3, 2022
@andytom
Copy link
Member

andytom commented Aug 4, 2022

Just to confirm does this happen only when the line_break module is disabled?

@andytom andytom added the needs info Needs more information from the issue creator. label Aug 4, 2022
@AbraxasDMG
Copy link
Author

AbraxasDMG commented Aug 4, 2022 via email

@davidkna
Copy link
Member

davidkna commented Aug 4, 2022

The recent path-slash bump changed how trailing slashes are handled (#4155, rhysd/path-slash#10).

@andytom andytom changed the title On Windows, when line_break disabled, drive root directory is missing backslash On Windows drive root directory is missing backslash Aug 4, 2022
@andytom andytom removed the needs info Needs more information from the issue creator. label Aug 5, 2022
@andytom
Copy link
Member

andytom commented Aug 19, 2022

Hey @AbraxasDMG, I think this should be fixed in the most recent release now can you confirm if that is the case?

@AbraxasDMG
Copy link
Author

AbraxasDMG commented Aug 19, 2022

Hi @andytom. It looks good now. Thank you very much!

@matchai matchai closed this as completed Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

4 participants