-
Notifications
You must be signed in to change notification settings - Fork 1
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
Long paths are truncated in watch mode #30
Comments
good catch @tcbegley , thanks |
What would be the most useful here? Something like |
For me that would be perfect |
I reckon what makes sense is to recursively remove directories before the last directory until it gets to an acceptable path length |
An alternative which provides more context than eliding intermediate directory names is to keep only the first character of each parent directory's name. For example,
|
I think just sticking a single letter in there is a bit confusing. I've just written something that replaces the longest directory with the first letter + … recursively, and if that doesn't get it below the char limit, it starts removing directories entirely (replacing with a single …) Does this seem reasonable? _trim_path('/hi/this/is/a/really_really/reeeeeeeeeeeeeeeeeally/loooooooooooooooooooooong/path.file')
'hi/this/is/a/really_really/r…/l…/path.file' |
To me that's more confusing than always reducing to a single character. Additionally, it's less apparent why a particular directory name has been elided than if it was just applied left-to-right, for example. |
Thanks for everyone's contributions and enthusiasm. Scott's suggestion is fairly common (the Fish prompt does this by default, I think, or maybe it's just my prompt), and should therefore be fairly familiar. That said, I think Jan's idea of having a first letter + In terms of where to truncate, I believe it'd be more aligned with people's expectations (and probably more useful) to start truncating directories at the beginning of the path rather than at the end, or rather than choosing the longest directories:
Can we just test that the ellipsis character prints reasonably on the Cygwin terminal in the Windows computer? |
will do @pbugnion! |
Can confirm that this does indeed print in cygwin. |
When using watch mode on a large project with many nested directories, I see only the first part of the path before it gets truncated. In particular the actual file name is hidden. Resizing the window has no effect.
Would it be possible to display something like
notebooks/.../folder/notebook_name.ipynb
etc.?The text was updated successfully, but these errors were encountered: