Skip to content
Advertisement

Getting number of pattern matches in VTE search

I’m developing a GTK+ 3.0 application that uses VTE widget, how can I get the number of occurrences for the search regex or at least get the current text in terminal and process that?
I’m using VTE 2.91 and Vala.

Advertisement

Answer

Vte.Terminal.get_text() will get you the currently visible text in the terminal for processing. I’m not sure that that includes text that’s scrolled off the screen.

You could try Vte.Terminal.select_all() followed by Vte.Terminal.copy_clipboard(), then get the copied text off the clipboard, but I’m not sure that will work.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement