microsoft / microsoft/PowerToys
Advanced Paste: As of v0.96.0, doesn't work, at all, unless clipboard history is turned on
- Dominant language
- C
- Stars
- 139k
- Forks
- 8.6k
- PR merge metrics
- PR metrics pending
Description
### Microsoft PowerToys version
0.97.1
### Installation method
GitHub
### Area(s) with issue?
Advanced Paste
### Steps to reproduce
Same exact problem from #43814
# 1. Disable Clipboard History
```powershell
Stop-Service -Name cbdhsvc
```
```powershell
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Clipboard" -Name "EnableClipboardHistory" -Value 0
```
I also have mine disabled
```powershell
Set-Service -Name cbdhsvc -StartupType Disabled
```
# 2. Attempt to open the 'Advanced Paste window' or use any of its keyboard shortcuts. Nothing happens.
# 3. Check the log for error
```shell
%LOCALAPPDATA%\Microsoft\PowerToys\AdvancedPaste\Logs
```
### ✔️ Expected Behavior
It opens or performs its shortcut mapped action, even if clipboard history is turned off (for security/privacy reasons), as it did before on v0.95.1
It should also detect if Clipboard history is disabled and gracefully grey out related settings rather than silently log an error.
### ❌ Actual Behavior
Nothing except for the error that's silently logged
### Additional Information
Old version works (v0.95.1)
Windows 10
Log output:
```log
[21:26:09.1602870] [Error] App.xaml.cs::App_UnhandledException::180
Unhandled exception
System.UnauthorizedAccessException (-2147024891): Access is denied.
Access is denied.
Stack trace:
at WinRT.ExceptionHelpers.g__Throw|38_0(Int32 hr)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.Windows.ApplicationModel.DataTransfer.IClipboardStatics2Methods.IsHistoryEnabled(IObjectReference _obj)
at Windows.ApplicationModel.DataTransfer.Clipboard.IsHistoryEnabled()
at AdvancedPaste.ViewModels.OptionsViewModel.UpdateClipboardTimestampAsync(Boolean formatsChanged)
at AdvancedPaste.ViewModels.OptionsViewModel.UpdateClipboardPreviewAsync()
at AdvancedPaste.ViewModels.OptionsViewModel.ReadClipboardAsync()
at AdvancedPaste.ViewModels.OptionsViewModel.OnShowAsync()
at AdvancedPaste.App.ShowWindow()
at AdvancedPaste.App.OnNamedPipeMessage(String message)
at AdvancedPaste.App.<>c__DisplayClass18_1.<b__2>d.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.b__128_0(Object state)
at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.b__0()
```
### Other Software
_No response_
Contributor guide
Research direction
Start with the logged call chain in AdvancedPaste.ViewModels.OptionsViewModel, especially UpdateClipboardTimestampAsync, UpdateClipboardPreviewAsync, ReadClipboardAsync, and OnShowAsync. Reproduce with Clipboard History disabled and inspect the Clipboard.IsHistoryEnabled call. Done means Advanced Paste opens and its shortcuts work without clipboard history, while related settings are handled visibly rather than failing silently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100