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

[Bug] file-size in dirvish-attributes makes lines wrap around in TTY sessions #115

Closed
3 tasks done
tsdh opened this issue Aug 5, 2022 · 6 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@tsdh
Copy link

tsdh commented Aug 5, 2022

Thank you for the bug report

  • I am using the latest version of dirvish related packages.
  • I checked FAQ|CUSTOMIZING|EXTENSIONS.
  • You may also try reproduce the issue using clean environment and minimal configurations with
    the command emacs -Q.

Bug description

I have file-size in my dirvish-attributes which works fine in sessions with a graphical frame but it seems there's something wrong with the column calculation in TTY frames where the last character of the file size is one column too far at the right and thus wraps around in the next line. Here's a screenshot showing the issue.

Screenshot-2022-08-05_070203

A possible candidate for that issue might be that dirvish assumes there are 1-column fringes which aren't there in TTY sessions. If that's the case, using the function fringe-columns in such calculations would be the right thing as they can also be customized (or disabled) in frame sessions.

EDIT: No, it doesn't seem like a fringe problem. I cannot reproduce the issue in a graphical frame after (setopt fringe-mode 0) which disables fringes.

Steps to reproduce

I can reproduce that behavior with at least the current emacs master branch starting with emacs -Q and then evaluating the following code in *scratch*:

(add-to-list 'load-path "~/.emacs.d/elpa/dirvish-20220804.1521")
(require 'dirvish)
(dirvish-override-dired-mode)
(setopt dirvish-attributes '(vc-state subtree-state collapse file-size))

Expected behavior

The file size does not make lines wrap around like in graphical sessions.

OS

Linux

Emacs Version

29

Emacs Configurations

vanilla

Error callstack

No response

Anything else

No response

@tsdh tsdh added the bug Something isn't working label Aug 5, 2022
@alexluigit
Copy link
Owner

Did 884abea fixed this?

@tsdh
Copy link
Author

tsdh commented Aug 5, 2022

Yes, but now it looks like I have 2 free columns right of the file size in a TTY frame where it was and still is just one column in a graphical frame.

TTY: image
Graphical: image

alexluigit added a commit that referenced this issue Aug 5, 2022
@alexluigit
Copy link
Owner

f2c5433 ?

@tsdh
Copy link
Author

tsdh commented Aug 5, 2022

Kind of. It works both in GUI as in TTY but not when I start a GUI emacs with a server and then connect to it via emacsclient -t. That's nothing you can test once and be done but you probably need to always check (window-system) which returns non-nil on any graphical window system and nil on terminals.

alexluigit added a commit that referenced this issue Aug 5, 2022
@alexluigit
Copy link
Owner

I see. I guess 95973cf should cut it. Thanks for your feedback.

@tsdh
Copy link
Author

tsdh commented Aug 5, 2022

Yes, that works fine now. Thanks a lot!

@tsdh tsdh closed this as completed Aug 5, 2022
alexluigit added a commit that referenced this issue Aug 9, 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
Projects
None yet
Development

No branches or pull requests

2 participants