@@ -299,17 +299,22 @@ async fn main() -> Result<()> { |
| 299 | 299 | } |
| 300 | 300 | // Check login button click |
| 301 | 301 | else if form.button_contains(click_x, click_y) && form.can_submit() { |
| 302 | | - // Get selected session exec command |
| 302 | + // Get selected session exec command and type |
| 303 | 303 | let session_exec = session_selector |
| 304 | 304 | .selected_exec() |
| 305 | 305 | .unwrap_or("gar-session.sh") |
| 306 | 306 | .to_string(); |
| 307 | + let session_type = session_selector |
| 308 | + .selected_type() |
| 309 | + .unwrap_or("x11") |
| 310 | + .to_string(); |
| 307 | 311 | |
| 308 | 312 | // Attempt login |
| 309 | 313 | if let Some(fade) = handle_login( |
| 310 | 314 | &mut client, |
| 311 | 315 | &mut form, |
| 312 | 316 | &session_exec, |
| 317 | + &session_type, |
| 313 | 318 | config.effective_fade_duration(), |
| 314 | 319 | ) |
| 315 | 320 | .await? |
@@ -352,17 +357,22 @@ async fn main() -> Result<()> { |
| 352 | 357 | |
| 353 | 358 | keycodes::RETURN => { |
| 354 | 359 | if form.focused_field == FocusedField::Password && form.can_submit() { |
| 355 | | - // Get selected session exec command |
| 360 | + // Get selected session exec command and type |
| 356 | 361 | let session_exec = session_selector |
| 357 | 362 | .selected_exec() |
| 358 | 363 | .unwrap_or("gar-session.sh") |
| 359 | 364 | .to_string(); |
| 365 | + let session_type = session_selector |
| 366 | + .selected_type() |
| 367 | + .unwrap_or("x11") |
| 368 | + .to_string(); |
| 360 | 369 | |
| 361 | 370 | // Attempt login |
| 362 | 371 | if let Some(fade) = handle_login( |
| 363 | 372 | &mut client, |
| 364 | 373 | &mut form, |
| 365 | 374 | &session_exec, |
| 375 | + &session_type, |
| 366 | 376 | config.effective_fade_duration(), |
| 367 | 377 | ) |
| 368 | 378 | .await? |
@@ -475,6 +485,7 @@ async fn handle_login( |
| 475 | 485 | client: &mut Client, |
| 476 | 486 | form: &mut LoginForm, |
| 477 | 487 | session_exec: &str, |
| 488 | + session_type: &str, |
| 478 | 489 | fade_duration_ms: u64, |
| 479 | 490 | ) -> Result<Option<FadeOutTransition>> { |
| 480 | 491 | form.is_loading = true; |
@@ -516,11 +527,12 @@ async fn handle_login( |
| 516 | 527 | |
| 517 | 528 | // Start session with selected session command |
| 518 | 529 | let session_cmd = vec![session_exec.to_string()]; |
| 519 | | - tracing::info!(?session_cmd, "Starting session"); |
| 530 | + tracing::info!(?session_cmd, %session_type, "Starting session"); |
| 520 | 531 | |
| 521 | 532 | let response = client |
| 522 | 533 | .request(&Request::StartSession { |
| 523 | 534 | cmd: session_cmd, |
| 535 | + session_type: session_type.to_string(), |
| 524 | 536 | env: vec![], |
| 525 | 537 | }) |
| 526 | 538 | .await?; |