feat: add support for printing explicit hyperlinks#12
feat: add support for printing explicit hyperlinks#12eugenesvk wants to merge 1 commit intojnoortheen:mainfrom
Conversation
bc80f61 to
44cca48
Compare
|
|
||
| XSH.env["PROMPT"] = ShellIntegrationPrompt(XSH.env) | ||
| if not _skip_alias: | ||
| XSH.aliases["print_link"] = utils.write_osc_hyperlink_alias |
There was a problem hiding this comment.
instead of defining it in three modules, can this be put in the module importing others (the entrypoint) ?
There was a problem hiding this comment.
but then you'd have aliases defined in different places and make the clean loader "dirty"
if not _skip_alias:
# this remains in the term module ↓
XSH.aliases["set_wezterm_user_var"] = utils.set_wezterm_user_var_alias
XSH.aliases["print_link"] = utils.write_osc_hyperlink_alias
# this would move to another file↑Also what if it turns out they'd need to be slightly different like with set_user_var?
Current encapsulation of all terminal-specific data, including aliases, in a terminal file seems better
There was a problem hiding this comment.
I prefer a DRY solution , can this be placed in its own module and be imported in the loader?
There was a problem hiding this comment.
But your suggestion isn't DRY, it trades one form of repetition for another while losing alias colocation: you'll have to repeat loading XONTRIB_TERM_INTEGRATIONS_SKIP_ALIAS and its conditional which each term will have to load to set unique user var aliases
There was a problem hiding this comment.
yes but loading will be only one time than 3 repeats or potentially any other terminals
There was a problem hiding this comment.
it will be 4 times: 3 times in each terminal file (for user vars aliases), and 1 time in your extra module
There was a problem hiding this comment.
why not move all aliases to one file then. I don't see any variations in the aliases. Also this PR changes in all three files seems excess.
There was a problem hiding this comment.
why not move all aliases to one file then.
because it doesn't solve any issue. Then you'd also have to repeat which-terminal check in this one file because...
I don't see any variations in the aliases
I've mentioned several times that user var alias name is unique
There was a problem hiding this comment.
I don't see any issue in your code. I just want to minimal change possible. I will work on this PR myself later.
Allows printing links like
print_link 'https://example.com' 'Example Domain'or via the regular import