terminal icon indicating copy to clipboard operation
terminal copied to clipboard

OpenConsole 1.21.2405.06002 doesn't work with Task Scheduler

Open brian6932 opened this issue 1 year ago • 2 comments

Windows Terminal version

1.21.1272.0

Windows build number

10.0.19044.4291

Other Software

Previously when you replaced conhost.exe with OpenConsole.exe there would be no problems, but now it breaks Task Scheduler, something between https://github.com/microsoft/terminal/compare/v1.20.11271.0...v1.21.1272.0. OpenConsole 1.20.2405.06001 works without fail.

Steps to reproduce

  1. Replace conhost.exe with OpenConsole.exe (cp OpenConsole.exe /c/windows/System32/conhost.exe -f)
  2. Try to run a scheduled task
  3. All scheduled tasks will result in 0xC0000142
  4. None actually properly run

Expected Behavior

Should work as before.

Actual Behavior

Tasks don't run.

brian6932 avatar May 08 '24 01:05 brian6932

I've just tested this in a VM and it seemed to work for me: image

Can you please export a task that reproduces the issue as XML and post it here?

lhecker avatar May 08 '24 14:05 lhecker

All CLI (daemon) scheduled tasks for me were effected, no matter if I was running as SYSTEM or user, here's one.

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2024-05-02T17:47:50.8814648</Date>
    <Author>hostname\username</Author>
    <URI>\sshd</URI>
  </RegistrationInfo>
  <Triggers>
    <BootTrigger>
      <Enabled>true</Enabled>
    </BootTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>...</UserId>
      <LogonType>Password</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <AllowHardTerminate>true</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <Priority>7</Priority>
    <RestartOnFailure>
      <Interval>PT1M</Interval>
      <Count>999</Count>
    </RestartOnFailure>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>C:\Users\username\scoop\apps\openssh\current\sshd.exe</Command>
    </Exec>
  </Actions>
</Task>

brian6932 avatar May 09 '24 07:05 brian6932