Weird behaviour with base64 text copy and paste
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.7k
- Forks
- 3.6k
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Description
-
[x ] I am on the latest Hyper.app version
-
[x ] I have searched the issues of this repo and believe that this is not a duplicate
-
OS version and name: macOS High Sierra 10.13.6
-
Hyper.app version: 2.0.0
-
Link of a Gist with the contents of your .hyper.js: https://gist.github.com/jeteon/ce99891adb58849f8a5e3abbae3fa860
-
Relevant information from devtools (CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere): N/A
-
The issue is reproducible in vanilla Hyper.app: Is Vanilla
Issue
Sometimes when I copy and paste text from Hyper, the formatting changes in subtle ways or the newlines are incorrect. I hadn't been able to reliably produce this behaviour until I had a corrupted SSL cert after copying from Hyper this morning. It seems to be that certain ASCII character sequences cause copy and paste to behave strangely. My styling in the current window is also reverted so I'm guessing I might have accidentally come across text input that was a broken shell formatting command.
It took some trial and error to try to find a way to reproduce this but I believe SSL certs are the ideal examples of this. It just takes some time to generate one that happens to have the right sequence in it. To reproduce it, just create an SSL cert and then copy and paste it within the same terminal window. I guess any sufficiently long sequence of randomish base64 with newlines to preserve line width will do though.
cd /tmp
mkdir hyper-ssl-copy-test
cd hyper-ssl-copy-test
openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -subj '/C=ZA
/ST=test/L=test/O=test/OU=Org/CN=www.example.com'
cat cert.pem
# Copy the certificate from the above and paste it back into the terminal
wc # We use wc to capture the text
It takes a few tries and I don't get it every time but on one run I had this as the certificate:
-----BEGIN CERTIFICATE-----
MIIDQDCCAigCCQC4TQnuU2Yy9DANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJa
QTENMAsGA1UECAwEdGVzdDENMAsGA1UEBwwEdGVzdDENMAsGA1UECgwEdGVzdDEM
MAoGA1UECwwDT3JnMRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20wHhcNMTgwODI4
MDgyMDU0WhcNMTkwODI4MDgyMDU0WjBiMQswCQYDVQQGEwJaQTENMAsGA1UECAwE
dGVzdDENMAsGA1UEBwwEdGVzdDENMAsGA1UECgwEdGVzdDEMMAoGA1UECwwDT3Jn
MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQDIy4Ow5JP5QM+PZkyi55bACBySIVgSd2ikkW2pS7EfizKarLa8
Z0lam2o/PzokRmhoe3bSkkvNS/cQ6EGqutJ5Eyvq2SygzwGeJLkrOdn/97mb6Ccr
Z02LLvdw95lg5w8n40VZrMPSZpaIIBvfXDps4yGqw1x9LlCPuqW6e8Mbbni3b+TN
BEhlJV2Od73YonxDkqhtvHP2GNGwAj4cZxSJbfjsbWfNNeLJokeuUryrChXn281X
8UR1N2gm7m75RHBo779LsmC2lRwypXr+oIB6kc1htkDkHMJRCgxAS0n68TMHs89V
YvsBpUFMzjPEBTT0FpUXpqy5dpNbT3es1QF/AgMBAAEwDQYJKoZIhvcNAQELBQAD
ggEBAG7Phi/KcNDkxPOO/wCWtyuZlwrxLwzNST57zrh2fBDTUkGawdRgvCkIco3v
eU6+wFKVvazzc49aX6kH5j+Frkz6gCIJO0WlhDN0SNZXEq/YnJ+3Rg7hLI8MPkbc
o/ppAY6OmWDXcJZkcKZ5yw0N4TZsq8o5tdFfnp3zRj9FiFJKewgZ/f2VI0i8OC2F
FFxTg3FEN0u893c+UB0ikppXed8TWs9ZMuBU0Bfgmxb/ABv2YZVZKvyUBCpHmLc1
KM8owtbAZjKvayxHFcSKo6AvzpQiFD5xbwRouqNQS1+0yRyPiISsTbQe4lix6dQg
CwDdlpcAvcPgaGPAjWcR0tDN370=
-----END CERTIFICATE-----
and this when I pasted it back into Hyper (can you spot the difference?):
-----BEGIN CERTIFICATE-----
MIIDQDCCAigCCQC4TQnuU2Yy9DANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJa
QTENMAsGA1UECAwEdGVzdDENMAsGA1UEBwwEdGVzdDENMAsGA1UECgwEdGVzdDEM
MAoGA1UECwwDT3JnMRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20wHhcNMTgwODI4
MDgyMDU0WhcNMTkwODI4MDgyMDU0WjBiMQswCQYDVQQGEwJaQTENMAsGA1UECAwE
dGVzdDENMAsGA1UEBwwEdGVzdDENMAsGA1UECgwEdGVzdDEMMAoGA1UECwwDT3Jn
MRgwFgYDVQQDDA93d3cuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQDIy4Ow5JP5QM+PZkyi55bACBySIVgSd2ikkW2pS7EfizKarLa8
Z0lam2o/PzokRmhoe3bSkkvNS/cQ6EGqutJ5Eyvq2SygzwGeJLkrOdn/97mb6Ccr
Z02LLvdw95lg5w8n40VZrMPSZpaIIBvfXDps4yGqw1x9LlCPuqW6e8Mbbni3b+TN
BEhlJV2Od73YonxDkqhtvHP2GNGwAj4cZxSJbfjsbWfNNeLJokeuUryrChXn281X
8UR1N2gm7m75RHBo779LsmC2lRwypXr+oIB6kc1htkDkHMJRCgxAS0n68TMHs89V
YvsBpUFMzjPEBTT0FpUXpqy5dpNbT3es1QF/AgMBAAEwDQYJKoZIhvcNAQELBQAD
ggEBAG7Phi/KcNDkxPOO/wCWtyuZlwrxLwzNST57zrh2fBDTUkGawdRgvCkIco3v
eU6+wFKVvazzc49aX6kH5j+Frkz6gCIJO0WlhDN0SNZXEq/YnJ+3Rg7hLI8MPkbc
o/ppAY6OmWDXcJZkcKZ5yw0N4TZsq8o5tdFfnp3zRj9FiFJKewgZ/f2VI0i8OC2F
FFxTg2YZVZKvyUBCpHmLc1
KM8owtbAZjKvayxHFcSKo6AvzpQiFD5xbwRouqNQS1+0yRyPiISsTbQe4lix6dQg
CwDdlpcAvcPgaGPAjWcR0tDN370=
-----END CERTIFICATE-----
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in vanilla Hyper.app on macOS using the openssl certificate commands, then compare the copied and pasted text, including line breaks and the altered certificate segment. Use the DevTools entry point mentioned in the report to trace clipboard and paste handling; done means the certificate is pasted without formatting or content changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, macos, typescript
- Domain
- cli, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100