Skip to main content
1 of 2
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

Well, the man page does say stuff can't be used for large inputs:

stuff [string]

Stuff the string string in the input buffer of the current window. This is like the "paste" command but with much less overhead. [...] You cannot paste large buffers with the "stuff" command. It is most useful for key bindings.

But it does hint at paste:

paste [registers [dest_reg]]

Write the (concatenated) contents of the specified registers to the stdin queue of the current window. The register '.' is treated as the paste buffer.

readbuf [-e encoding] [filename]

Reads the contents of the specified file into the paste buffer. [...]

I tried it by pasting the screen man page (2600 lines, 166 kB) to an editor:

screen -S test -X readbuf /tmp/screen.txt
screen -S test -X paste .

and got the identical file back after saving it, so it seems paste might work better. This does have the downside of requiring more than one command, though, and I don't know if it can be done without passing the data through a file.

In any case, I'm not sure if pasting data through screen is the best way to send commands to a running server, but I don't know if Minecraft provides other ways to send commands than stdin.

ilkkachu
  • 147.9k
  • 16
  • 268
  • 441