Skip to content

Hyperlinks break width detection #26

@maxbla

Description

@maxbla

Following instructions in this gist, the way to print a hyperlink in the terminal with rust is something like format!("\x1b]8;;{}\x1b\\{}\x1b]8;;\x1b\\", display, url) which displays in the terminal as having width display.len(), but tabled appears to think its display width is approximately 14+display.len()+url.len(). This and others are listed in the operating system command section of the relevant wikipedia page.

An example of the results

┌─────────────────────────────────────────────────────────────────────────────┬────────────────────┐
│                                    name                                     │     similarity     │
├─────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ Person1 │        100         │
│         Person2         │ 65.38461538461539  │
│      Person3      │ 62.962962962962955 │
│    Person4    │ 62.962962962962955 │
│       Person5       │ 60.714285714285715 │
└─────────────────────────────────────────────────────────────────────────────┴────────────────────┘

after glancing at some docs, I think the underlying issue is with ansi-parser

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions