chris-marsh / pureline

A Pure Bash Powerline PS1 Command Prompt
MIT License
507 stars 95 forks source link

Pwd segment #53

Closed bug-ware closed 3 years ago

bug-ware commented 3 years ago

The pwd-segment is similar to the path-segment but shows the folders as powerline using soft-separator. The option $PL_PATH_TRIM is handled the same as in path-segment.

bug-ware commented 3 years ago

Hi.

  1. I hope I got it right. I think the hard coded symbol you mentioned was an ellipsis like symbol used to indicated the trimmed path? PL_SYMBOLS[soft_separator] was used already. I introduced segment symbols named pwd_separator and pwd_trimmed.

  2. I changed these lines to introduce pwd_* symbols.

  3. I was thinking to initialize pwd_separator with the value of ${PL_SYMBOL[soft_separator]} instead of a hard coded symbol, i.e.: [[ -z ${PL_SYMBOLS[pwd_separator]} ]] && PL_SYMBOLS[pwd_separator]=${PL_SYMBOLS[soft_separator]} Will this give issues, e.g., if some changed soft_separator in the config after pwd_segment was inititalized? Seems to work though.