File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export default class InkTerminal extends PaneItem {
82
82
cols : 100 ,
83
83
rows : 30 ,
84
84
scrollback : 5000 ,
85
- tabStopWidth : 4
85
+ tabStopWidth : 4 ,
86
86
} , opts )
87
87
88
88
if ( process . platform === 'win32' ) {
@@ -98,7 +98,12 @@ export default class InkTerminal extends PaneItem {
98
98
}
99
99
100
100
this . terminal = new Terminal ( opts )
101
- const webLinksAddon = new WebLinksAddon ( ( ev , uri ) => openExternal ( uri ) )
101
+ const webLinksAddon = new WebLinksAddon ( ( ev , uri ) => {
102
+ if ( ! this . shouldOpenLink ( ev ) ) return false
103
+ openExternal ( uri )
104
+ } , {
105
+ willLinkActivate : ev => this . shouldOpenLink ( ev )
106
+ } )
102
107
this . terminal . loadAddon ( webLinksAddon )
103
108
104
109
this . searchAddon = new SearchAddon ( )
@@ -140,6 +145,14 @@ export default class InkTerminal extends PaneItem {
140
145
this . view . className = name
141
146
}
142
147
148
+ shouldOpenLink ( ev ) {
149
+ return true
150
+ }
151
+
152
+ onDidOpenLink ( f ) {
153
+ this . shouldOpenLink = f
154
+ }
155
+
143
156
cursorPosition ( ) {
144
157
this . write ( '\x1b[0m' )
145
158
return [ this . terminal . _core . buffer . x , this . terminal . _core . buffer . y ]
You can’t perform that action at this time.
0 commit comments