Open Diogo-Rossi opened 1 month ago
@Diogo-Rossi this implies a completely new style as we do not loop the folder backwards just yet. But this can be done. I would count the separators as that's more intuitive when deciding prompt length. I would always count the root too for the same reason.
Code of Conduct
What would you like to see changed/added?
In Path segment, the "Agnoster Short" style has a
max_depth
property:I would like to have a different property named
max_length
. So, when the full current working directory string has more thanmax_length
characters, it renders the names of the last folders until it reachesmax_length
characters.Example:
Suppose that
max_length=36
and the current work directory isC:/Users/myUser/folder
Then, the length of the current work directory is:22
if you count the separators,19
if you don't count separators. In any case, it is less than36
, so it would display the full current working directory as a full string.Now, suppose that
max_length=36
and the current work directory isC:/Users/myUser/folder/subfolder/last_folder
Then, the length of the current work directory is:44
if you count the separators,39
if you don't count separators. In any case, it is greater than36
, so it would display the names of the last folders until the full string reaches <=36
characters, i.e.:C:/📁/📁/folder/subfolder/last_folder
(This has 35 characters if you count the separators, 30 if you don't count them)
hide_root_location
maybe?)Is that feasible?