Fix directory truncation

- Set the truncation character and break before prepending the latest
  path component.
- Insert first cwd char before the truncation character (i.e. ~ or /).