@@ -155,7 +155,6 @@ impl<W: Write> StreamSession<W> {
155
155
pub struct PtySession {
156
156
pub process : PtyProcess ,
157
157
pub stream : StreamSession < File > ,
158
- pub commandname : String , // only for debugging purposes now
159
158
}
160
159
161
160
// make StreamSession's methods available directly
@@ -192,19 +191,11 @@ impl DerefMut for PtySession {
192
191
/// # }
193
192
/// ```
194
193
impl PtySession {
195
- fn new (
196
- process : PtyProcess ,
197
- timeout_ms : Option < u64 > ,
198
- commandname : String ,
199
- ) -> Result < Self , Error > {
194
+ fn new ( process : PtyProcess , timeout_ms : Option < u64 > ) -> Result < Self , Error > {
200
195
let f = process. get_file_handle ( ) ;
201
196
let reader = f. try_clone ( ) ?;
202
197
let stream = StreamSession :: new ( reader, f, timeout_ms) ;
203
- Ok ( Self {
204
- process,
205
- stream,
206
- commandname,
207
- } )
198
+ Ok ( Self { process, stream } )
208
199
}
209
200
}
210
201
@@ -241,11 +232,10 @@ pub fn spawn(program: &str, timeout_ms: Option<u64>) -> Result<PtySession, Error
241
232
242
233
/// See `spawn`
243
234
pub fn spawn_command ( command : Command , timeout_ms : Option < u64 > ) -> Result < PtySession , Error > {
244
- let commandname = format ! ( "{:?}" , & command) ;
245
235
let mut process = PtyProcess :: new ( command) ?;
246
236
process. set_kill_timeout ( timeout_ms) ;
247
237
248
- PtySession :: new ( process, timeout_ms, commandname )
238
+ PtySession :: new ( process, timeout_ms)
249
239
}
250
240
251
241
/// A repl session: e.g. bash or the python shell:
0 commit comments