A
A
Alexey Yarkov2022-01-13 18:18:40
Command line
Alexey Yarkov, 2022-01-13 18:18:40

Is it possible to display the clickable path to a file in the terminal?

A specific Wishlist is this))

In the process of assembling the project, the following lines are displayed in the terminal:

Сборка компонента "CardsCarousel" (/usr/app/vueapp/src/webparts/CardsCarousel/entry.ts) завершена


Is it possible the way
/usr/app/vueapp/src/webparts/CardsCarousel/entry.ts
make it clickable like a hyperlink? And on click open for example Nautilus or open a file in VSCode.

The terminal is standard Ubuntu. If you can do it cross-platform, then generally good.

PS Googled, but maybe today I was banned there.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Karabanov, 2022-01-13
@yarkov

file:///usr/app/vueapp/src/webparts/CardsCarousel/entry.ts

It will be highlighted as a link, if you hold down Ctrl and left-click, the file will open in the program that is assigned to the *.ts file handler - probably in a text editor.

U
uvelichitel, 2022-01-13
@uvelichitel

urxvt terminal certainly knows how. He knows everything. For example, it has a standard extension -- matcher. You can try to configure something like this in ~/.Xresource

URxvt.perl-ext-common:      default,matcher
# key bindings
URxvt.matcher.button:       1
URxvt.keysym.C-Delete:    matcher:last
URxvt.keysym.M-Delete:    matcher:list
# regexps
URxvt.matcher.pattern.1: (?:\\s)([\\~\\.]?\\/\{1,1\}[\\.\\w]\\S+)\\b
# launchers
URxvt.matcher.launcher.1:  VSCode $1
URxvt.urlLauncher:          xdg-open
# change the font highlight style
!URxvt.matcher.rend.1:          Uline fg01

X
xotkot, 2022-01-13
@xotkot

you can use alacritty
Hints
to edit the config, see more specifically: alacritty.yml#L458
as an example:

hints:
  enabled:
  - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
            [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
    command: xdg-open
    post_processing: true
    mouse:
      enabled: true
      mods: None
    binding:
      key: U
      mods: Control|Shift

  - regex: "/{0,}.(txt|ts)"
    command: /usr/bin/code
    post_processing: true
    mouse:
      enabled: true
      mods: None

when you click on /usr/app/vueapp/src/webparts/CardsCarousel/entry.ts , from your example, it will launch this file in the vscode program (/usr/bin/code)
plus alacritty itself is cross-platform, that is, it works natively and under Windows

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question