@@ -179,8 +179,7 @@ func StartRemoteShellProc(termSize waveobj.TermSize, cmdStr string, cmdOpts Comm
179
179
} else {
180
180
if cmdOpts .Login {
181
181
shellOpts = append (shellOpts , "-l" )
182
- }
183
- if cmdOpts .Interactive {
182
+ } else if cmdOpts .Interactive {
184
183
shellOpts = append (shellOpts , "-i" )
185
184
}
186
185
// zdotdir setting moved to after session is created
@@ -189,12 +188,6 @@ func StartRemoteShellProc(termSize waveobj.TermSize, cmdStr string, cmdOpts Comm
189
188
log .Printf ("combined command is: %s" , cmdCombined )
190
189
} else {
191
190
shellPath = cmdStr
192
- if cmdOpts .Login {
193
- shellOpts = append (shellOpts , "-l" )
194
- }
195
- if cmdOpts .Interactive {
196
- shellOpts = append (shellOpts , "-i" )
197
- }
198
191
shellOpts = append (shellOpts , "-c" , cmdStr )
199
192
cmdCombined = fmt .Sprintf ("%s %s" , shellPath , strings .Join (shellOpts , " " ))
200
193
log .Printf ("combined command is: %s" , cmdCombined )
@@ -301,8 +294,7 @@ func StartShellProc(termSize waveobj.TermSize, cmdStr string, cmdOpts CommandOpt
301
294
} else {
302
295
if cmdOpts .Login {
303
296
shellOpts = append (shellOpts , "-l" )
304
- }
305
- if cmdOpts .Interactive {
297
+ } else if cmdOpts .Interactive {
306
298
shellOpts = append (shellOpts , "-i" )
307
299
}
308
300
}
@@ -312,12 +304,6 @@ func StartShellProc(termSize waveobj.TermSize, cmdStr string, cmdOpts CommandOpt
312
304
shellutil .UpdateCmdEnv (ecmd , map [string ]string {"ZDOTDIR" : shellutil .GetZshZDotDir ()})
313
305
}
314
306
} else {
315
- if cmdOpts .Login {
316
- shellOpts = append (shellOpts , "-l" )
317
- }
318
- if cmdOpts .Interactive {
319
- shellOpts = append (shellOpts , "-i" )
320
- }
321
307
shellOpts = append (shellOpts , "-c" , cmdStr )
322
308
ecmd = exec .Command (shellPath , shellOpts ... )
323
309
ecmd .Env = os .Environ ()
0 commit comments