Skip to content

Is jansi supporting OSC8 command needed to create a hyperlink in a terminal #314

@cmoulliard

Description

@cmoulliard

Question

Is jansi supporting OSC8 command need to create a hyperlink in a terminal ?

The following code don't work for me within intellij console or iterm2 fish console

 /**
     * Helper function to create an OSC 8 terminal hyperlink.
     * \u001B is the ESCAPE character.
     * \u001B\\ is the String Terminator (ST).
     *
     * See: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
     *
     *  printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'
     */
    private static String createLink(String text, String url) {
        String ESC_CHAR = "\u001B";
        String ST = "\u001B\\"; // String Terminator
        String OSC8_START = ESC_CHAR + "]8;;" + url + ST;
        String OSC8_END = ESC_CHAR + "]8;;" + ST;
        return OSC8_START + text + OSC8_END;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions