def test_command_output_continuation(windows_bash_session):
    """Test retrieving continued output using empty command after timeout."""
    # Windows PowerShell version
    action = CmdRunAction('1..5 | ForEach-Object { Write-Output $_; Start-Sleep 3 }')
    action.set_hard_timeout(2.5)
    obs = windows_bash_session.execute(action)
    assert obs.content.strip() == '1'
    assert obs.metadata.prefix == ''
    assert '[The command timed out after 2.5 seconds.' in obs.metadata.suffix

    # Continue watching output
    action = CmdRunAction('')
    action.set_hard_timeout(2.5)
    obs = windows_bash_session.execute(action)
    assert '[Below is the output of the previous command.]' in obs.metadata.prefix
    assert obs.content.strip() == '2'
    assert '[The command timed out after 2.5 seconds.' in obs.metadata.suffix

    # Continue until completion
    for expected in ['3', '4', '5']:
        action = CmdRunAction('')
        action.set_hard_timeout(2.5)
        obs = windows_bash_session.execute(action)
        assert '[Below is the output of the previous command.]' in obs.metadata.prefix
        assert obs.content.strip() == expected
        assert '[The command timed out after 2.5 seconds.' in obs.metadata.suffix

    # Final empty command to complete
    action = CmdRunAction('')
    obs = windows_bash_session.execute(action)
    assert '[The command completed with exit code 0.]' in obs.metadata.suffix
Test retrieving continued output using empty command after timeout.
tests/unit/test_windows_bash.py