fix cliboard using a deprecated API#1549
Open
themoonisacheese wants to merge 5 commits into
Open
Conversation
Spawn dbus-monitor as a libuv subprocess to watch for desktop notifications on the session bus. Notifications are parsed, filtered to avoid browser feedback loops, and forwarded to all connected clients as native Browser Notifications. New option: -N, --monitor-notifications
When no notification daemon owns org.freedesktop.Notifications, ttyd registers itself via sd-bus (dedicated thread + uv_async_t). Falls back to dbus-monitor when a daemon already exists.
Send DECSET 1004 on connect so Crush's DECRPM ?1004 query reports supported, and send focus/blur events so Crush's shouldSendNotification gate check passes (condition tsl0922#3: window not focused).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ttyd's onSelectionChange handler uses document.execCommand("copy") to copy selected text. This is broken in two
ways:
document.execCommandis deprecated and being removed from browsers.<canvas>element, which has no DOM text selection.execCommand("copy")copies the browser's text selection, which is empty on a canvas, so nothing ever reaches the clipboard regardless of whether the API is available.The fix replaces
document.execCommand("copy")withnavigator.clipboard.writeText(terminal.getSelection()):navigator.clipboard.writeText()is the modern Clipboard API and is the only path that will work going forward.terminal.getSelection()reads text from xterm.js's internal buffer model, which works correctly on both canvas and DOM renderers.