@@ -63,7 +63,7 @@ impl RuntimeBuilder for ZshRuntimeBuilder {
63
63
pub struct ZshRuntime {
64
64
path : OsString ,
65
65
home : PathBuf ,
66
- timeout : Duration ,
66
+ _timeout : Duration ,
67
67
}
68
68
69
69
impl ZshRuntime {
@@ -93,7 +93,7 @@ PROMPT='%% '
93
93
Ok ( Self {
94
94
path,
95
95
home,
96
- timeout : Duration :: from_millis ( 100 ) ,
96
+ _timeout : Duration :: from_millis ( 100 ) ,
97
97
} )
98
98
}
99
99
@@ -110,15 +110,20 @@ PROMPT='%% '
110
110
}
111
111
112
112
/// Get the output from typing `input` into the shell
113
- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
113
+ pub fn complete (
114
+ & mut self ,
115
+ input : & str ,
116
+ term : & Term ,
117
+ timeout : Duration ,
118
+ ) -> std:: io:: Result < String > {
114
119
let mut command = Command :: new ( "zsh" ) ;
115
120
command. arg ( "--noglobalrcs" ) ;
116
121
command
117
122
. env ( "PATH" , & self . path )
118
123
. env ( "TERM" , "xterm" )
119
124
. env ( "ZDOTDIR" , & self . home ) ;
120
125
let echo = false ;
121
- comptest ( command, echo, input, term, self . timeout )
126
+ comptest ( command, echo, input, term, timeout)
122
127
}
123
128
}
124
129
@@ -131,8 +136,8 @@ impl Runtime for ZshRuntime {
131
136
self . register ( name, content)
132
137
}
133
138
134
- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
135
- self . complete ( input, term)
139
+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
140
+ self . complete ( input, term, timeout )
136
141
}
137
142
}
138
143
@@ -164,7 +169,7 @@ pub struct BashRuntime {
164
169
path : OsString ,
165
170
home : PathBuf ,
166
171
config : PathBuf ,
167
- timeout : Duration ,
172
+ _timeout : Duration ,
168
173
}
169
174
170
175
impl BashRuntime {
@@ -198,7 +203,7 @@ PS1='% '
198
203
path,
199
204
home,
200
205
config : config_path,
201
- timeout : Duration :: from_millis ( 50 ) ,
206
+ _timeout : Duration :: from_millis ( 50 ) ,
202
207
} )
203
208
}
204
209
@@ -217,7 +222,12 @@ PS1='% '
217
222
}
218
223
219
224
/// Get the output from typing `input` into the shell
220
- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
225
+ pub fn complete (
226
+ & mut self ,
227
+ input : & str ,
228
+ term : & Term ,
229
+ timeout : Duration ,
230
+ ) -> std:: io:: Result < String > {
221
231
let mut command = Command :: new ( "bash" ) ;
222
232
let inputrc_path = self . home . join ( ".inputrc" ) ;
223
233
command
@@ -226,7 +236,7 @@ PS1='% '
226
236
. env ( "INPUTRC" , & inputrc_path)
227
237
. args ( [ OsStr :: new ( "--rcfile" ) , self . config . as_os_str ( ) ] ) ;
228
238
let echo = !input. contains ( "\t \t " ) ;
229
- comptest ( command, echo, input, term, self . timeout )
239
+ comptest ( command, echo, input, term, timeout)
230
240
}
231
241
}
232
242
@@ -239,8 +249,8 @@ impl Runtime for BashRuntime {
239
249
self . register ( name, content)
240
250
}
241
251
242
- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
243
- self . complete ( input, term)
252
+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
253
+ self . complete ( input, term, timeout )
244
254
}
245
255
}
246
256
@@ -271,7 +281,7 @@ impl RuntimeBuilder for FishRuntimeBuilder {
271
281
pub struct FishRuntime {
272
282
path : OsString ,
273
283
home : PathBuf ,
274
- timeout : Duration ,
284
+ _timeout : Duration ,
275
285
}
276
286
277
287
impl FishRuntime {
303
313
Ok ( Self {
304
314
path,
305
315
home,
306
- timeout : Duration :: from_millis ( 50 ) ,
316
+ _timeout : Duration :: from_millis ( 50 ) ,
307
317
} )
308
318
}
309
319
@@ -320,15 +330,20 @@ end;
320
330
}
321
331
322
332
/// Get the output from typing `input` into the shell
323
- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
333
+ pub fn complete (
334
+ & mut self ,
335
+ input : & str ,
336
+ term : & Term ,
337
+ timeout : Duration ,
338
+ ) -> std:: io:: Result < String > {
324
339
let mut command = Command :: new ( "fish" ) ;
325
340
command
326
341
. env ( "PATH" , & self . path )
327
342
// fish requires TERM to be set.
328
343
. env ( "TERM" , "xterm" )
329
344
. env ( "XDG_CONFIG_HOME" , & self . home ) ;
330
345
let echo = false ;
331
- comptest ( command, echo, input, term, self . timeout )
346
+ comptest ( command, echo, input, term, timeout)
332
347
}
333
348
}
334
349
@@ -341,8 +356,8 @@ impl Runtime for FishRuntime {
341
356
self . register ( name, content)
342
357
}
343
358
344
- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
345
- self . complete ( input, term)
359
+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
360
+ self . complete ( input, term, timeout )
346
361
}
347
362
}
348
363
@@ -374,7 +389,7 @@ pub struct ElvishRuntime {
374
389
path : OsString ,
375
390
home : PathBuf ,
376
391
config : PathBuf ,
377
- timeout : Duration ,
392
+ _timeout : Duration ,
378
393
}
379
394
380
395
impl ElvishRuntime {
@@ -403,7 +418,7 @@ set edit:prompt = (constantly \"% \")
403
418
path,
404
419
home,
405
420
config : config_path,
406
- timeout : Duration :: from_millis ( 50 ) ,
421
+ _timeout : Duration :: from_millis ( 50 ) ,
407
422
} )
408
423
}
409
424
@@ -422,13 +437,18 @@ set edit:prompt = (constantly \"% \")
422
437
}
423
438
424
439
/// Get the output from typing `input` into the shell
425
- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
440
+ pub fn complete (
441
+ & mut self ,
442
+ input : & str ,
443
+ term : & Term ,
444
+ timeout : Duration ,
445
+ ) -> std:: io:: Result < String > {
426
446
let mut command = Command :: new ( "elvish" ) ;
427
447
command
428
448
. env ( "PATH" , & self . path )
429
449
. env ( "XDG_CONFIG_HOME" , & self . home ) ;
430
450
let echo = false ;
431
- comptest ( command, echo, input, term, self . timeout )
451
+ comptest ( command, echo, input, term, timeout)
432
452
}
433
453
}
434
454
@@ -441,8 +461,8 @@ impl Runtime for ElvishRuntime {
441
461
self . register ( name, content)
442
462
}
443
463
444
- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
445
- self . complete ( input, term)
464
+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
465
+ self . complete ( input, term, timeout )
446
466
}
447
467
}
448
468
0 commit comments