Skip to content
Snippets Groups Projects

DDFileLister: When displaying a file description, remove/replace cursor movement characters, which can corrupt the display

2 unresolved threads

DDFileLister: When displaying a file description, remove/replace cursor movement characters, which can corrupt the display

Merge request reports

Pipeline #6620 passed

Pipeline passed for 705d7f9c on dd_file_lister_description_remove_or_replace_cursor_movement_attrs

Approval is optional

Merged by Rob SwindellRob Swindell 5 months ago (Sep 16, 2024 7:17pm UTC)

Merge details

  • Changes merged into master with c43549ff (commits were squashed).
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • File descriptions aren't supposed to have cursor movements codes in the first place, so I'm curious how this is happening.

      Are we talking about file summary/descriptions, or extended descriptions (e.g. imported from TIC or DIZ) here?

      How'd these files get added to the filebase in the first place?

    • Author Developer

      They're from extended descriptions from a diz. I uploaded them yo my BBS (for testing) using the ;UPLOAD coand. These are a couple examples:

      http://digitaldistortionbbs.com/api/files.ssjs?call=download-file&dir=uploads_up_other&file=avpack23.zip

      http://digitaldistortionbbs.com/api/files.ssjs?call=download-file&dir=uploads_up_other&file=blndr2022b.zip

      Nelgin reportrd this; I downloaded these files from his BBS. He says he used addfiles eith the -diz option. I noticed these seem to at least have a / (newline) attribute.

      Edited by Eric Oulashin
    • I imported adpack23.zip into vert and the extended description display fine, at least using the built file lister, in sbbs. I do see there are Ctrl-A codes for cursor-right positioning (which would need to be replaced with spaces, at minimum, for the original art to display correctly) and the conditional-newline sequence (Ctrl-A/) is also required for proper display matching the screen width provided in the SAUCE record of the FILE_ID.ANS file.

      I'm not clear why these codes would be problematic for DDFileLister.

    • For the record, this is the original image that I showed Nightfox.

      image

    • Author Developer

      The cursor codes are problematic for DDMsgReader because, when using the scrolling ANSI interface, it writes the extended descriptions to the right of the file list; it doesn't expect the cursor to be moved when writing the description, so that currently is causing issues when displaying the descriptions, as part of the description ends up over the file list. Similar issues happen when viewing file info, where it uses a scrollable window on the screen (using frame.js). I think the best solution would be for DDFileLister to remove these cursor positioning codes so that they aren't a problem when writing the extended descriptions.

    • Author Developer

      When viewing information about avpack23.zip, without removing these control characters: image

      And if it removes the control characters, it looks better: image image

    • Author Developer

      avpack23.zip without this fix:

      image

      avpack23.zip with this fix:

      image

    • Please register or sign in to reply
  • Eric Oulashin added 1 commit

    added 1 commit

    • 705d7f9c - DDFileLister: Replace cursor-right codes in descriptions properly

    Compare with previous version

  • Author Developer

    Another example where the description looks bad when viewing file info without removing/replacing the cursor positioning codes:

    image

    The same when the cursor position codes are removed/replaced:

    image

    Edited by Eric Oulashin
    • Most of the Ctrl-A codes being stripped in this change should not actually exist in an extended description in the first place. So it just kind of looks like extra code/compares added for no reason.

      Replacing a conditional new-line sequence with nothing (blank string), doesn't seem like the correct thing to do either.

      All that said, I'll merge the change, but I expect you'll still have some problems with some imported/converted ANSI descriptions with this change.

    • Author Developer

      When using an ANSI terminal, it will replace a conditional newline with an actual newline. Only when displaying the short (1-line) descriptions, with extended descriptions turned off, will it replace the conditional newline with nothing.

    • Are you actually seeing Ctrl-A codes in short (1-line) descriptions? You should not.

    • Author Developer

      I haven't done a thorough check. My concern was that if a file is imported (by addfiles with -diz), it might take the first line of the diz for the short 1-line description, and if some of these diz files have cursor control codes, the control codes could potentially be anywhere in the diz. I'm not sure if addfiles takes the first line of a diz for the short description though.

    • File descriptions should never have Ctrl-A codes in them - they are stripped during import.

    • Please register or sign in to reply
  • merged

  • Rob Swindell mentioned in commit c43549ff

    mentioned in commit c43549ff

  • Please register or sign in to reply
    Loading