You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clipboard input was previously converted into one signal per line using linesWithSeparators.
Because machine signal queues are limited, files containing many short lines could be truncated even when their total size was relatively small. The misc.maxClipboard configuration value existed, but was NOT used by this signal path. Many players even attempted to condense their scripts into a single line. It's painful.
Large pastes into the OpenOS editor also trigger many GPU redraw operations, which could exhaust the computer's energy before all clipboard signals were processed. Energy usage is not necessary.
Summary
Wire misc.maxClipboard into runtime settings.
Pack clipboard text into maximum-sized signal chunks across line boundaries while preserving line separators.
Derive the client-side paste limit from the clipboard chunk size and machine signal queue capacity.
Avoid charging normal computer and GPU operation energy while processing clipboard input.
Hi @shironakoushi , thanks for your work on this!
However, I'm a bit concerned about this PR, because it introduces a breaking change to how clipboard pasting signals work.
Switching from per-line signals to 256-character batches will break existing scripts that expect the old behavior.
Additionally, the issue this PR tries to solve (the 256 signal queue limit) is already configurable in the OC settings.
And the original dev actually looked into multi-line pasting before, but decided against it just to avoid this exact issue (see MightyPirates#3084 (comment)).
For these reasons, I believe this new behavior at least needs a config to toggle it, so we don't break backward compatibility. Would you be open to making a follow-up PR to add a toggle for this?
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
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.
Motivation
Clipboard input was previously converted into one signal per line using
linesWithSeparators.Because machine signal queues are limited, files containing many short lines could be truncated even when their total size was relatively small. The
misc.maxClipboardconfiguration value existed, but was NOT used by this signal path. Many players even attempted to condense their scripts into a single line. It's painful.Large pastes into the OpenOS editor also trigger many GPU redraw operations, which could exhaust the computer's energy before all clipboard signals were processed. Energy usage is not necessary.
Summary
misc.maxClipboardinto runtime settings.Checklist