3

I'm in a bad spot. I spent 8 month's working on a portfolio project believing that I could render terminal hyperlinks in the node library called Blessed. My problem is that I thought I was doing it successfully at one point, but now realized it's not happening (I probably mislead myself by successfully outputting directly to node, and later wrongly convinced myself I did it in Blessed). What I'm humbly asking here is if someone can solve the issue, outlined here, either through available Blessed methods or modifying Blessed. Please see my code below. Thanks for considering my plight.

import terminalLink from 'terminal-link'
import React, { useRef, useState, useEffect } from 'react';
import blessed, { box } from 'blessed';
import { render } from 'react-blessed';

const App = () => {
  const link = terminalLink("Example", "http://example.com") 
    return (
        <box
        left="0"
        mouse
        inputOnFocus
        tags
        top="0"
        width="100%"
        height="100%"
        border={{type: 'line'}}
        >
      {link}
      </box> 
    
    );
  };

const screen = blessed.screen({
    autoPadding: true,
    smartCSR: true,
    title: 'Termichat'
});


screen.key(['escape', 'q', 'C-c', 'C-e', 'enter', 'C-enter'], (ch, key) => {
    if (key.sequence === '\x1B' || ch === 'q') {
        process.exit(0)
    }
});

const component = render(<App />, screen);
Zach_is_my_name
  • 59
  • 3
  • 14
  • I should add that I am testing against terminals which support hyperlinks... outside of tmux, because it does not – Zach_is_my_name Aug 22 '22 at 17:40
  • Blessed documentation states that SGR (which I read as ANSI) escape sequences are passed through... which they are... applying bold or colors works. But Blessed must not account for the newer hyperlink OSC escape in the section where the 'pass-through' is implemented – Zach_is_my_name Aug 22 '22 at 17:49
  • 1
    It seems like this question is simply asking for people to fix a bug in a third-party library for you. Am I missing something? – Michael M. Sep 04 '22 at 14:56
  • @MichaelM. Every question on the stack network is essentionally doing that, and I've seen countless "solve this problem for me... and here's my 300 line uncontextualization, ungeneralized code dump".. a simple tweak of phrasing on my part and you wouldn't have grounds to state such... I'm asking for **help**, where have I indicated I'm not seeking to learn from this? My conscience is clear – Zach_is_my_name Sep 07 '22 at 22:52
  • this is a problem regarding a known bug in a third-party library. I think that this question would be better suited for Blessed’s GitHub issue for this exact problem. – Michael M. Sep 08 '22 at 12:56

0 Answers0