<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ghostty.git/src/input/paste.zig, branch tip</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/'/>
<entry>
<title>Move paste encoding to the input package, test, optimize away one alloc</title>
<updated>2025-10-04T21:05:32+00:00</updated>
<author>
<name>Mitchell Hashimoto</name>
<email>m@mitchellh.com</email>
</author>
<published>2025-10-04T20:24:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/ghostty.git/commit/?id=d4dcecb071a113f5a27ab2948c721384210114fc'/>
<id>d4dcecb071a113f5a27ab2948c721384210114fc</id>
<content type='text'>
This moves our paste logic to `src/input` in preparation for exposing
this as part of libghostty-vt. This yields an immediate benefit of
unit tests for paste encoding. 

Additionally, we were able to remove one allocation on every unbracketed
paste path unless the input specifically contains a newline. Unlikely to
be noticable, but nice.

NOTE: This also includes one change in behavior: we no longer encode
`\r\n` and a single `\r`, but as a duplicate `\r\r`. This matches xterm
behavior and I don't think will result in any issues since duplicate
carriage returns should do nothing in well-behaved terminals.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves our paste logic to `src/input` in preparation for exposing
this as part of libghostty-vt. This yields an immediate benefit of
unit tests for paste encoding. 

Additionally, we were able to remove one allocation on every unbracketed
paste path unless the input specifically contains a newline. Unlikely to
be noticable, but nice.

NOTE: This also includes one change in behavior: we no longer encode
`\r\n` and a single `\r`, but as a duplicate `\r\r`. This matches xterm
behavior and I don't think will result in any issues since duplicate
carriage returns should do nothing in well-behaved terminals.
</pre>
</div>
</content>
</entry>
</feed>
