[HN Gopher] Is there a maximum size for Windows clipboard data?
       ___________________________________________________________________
        
       Is there a maximum size for Windows clipboard data?
        
       Author : kencausey
       Score  : 179 points
       Date   : 2022-06-08 14:16 UTC (8 hours ago)
        
 (HTM) web link (devblogs.microsoft.com)
 (TXT) w3m dump (devblogs.microsoft.com)
        
       | dataflow wrote:
       | > Next time, we'll see what we can do to extend this timeout.
       | 
       | I guess I'm impatient... how does one go about this?
        
         | jbverschoor wrote:
         | There shouldn't be an arbitrary timeout. Anything that isn't
         | instantly should have a UI showing progress / ability to cancel
         | (or even pause).
        
           | londons_explore wrote:
           | I believe there is such an API... If you copy a file out of a
           | rar archive and paste it into Gmail, you get to see the UI
           | pop up and extraction begin...
        
         | hermitdev wrote:
         | I don't know, but I'd except a follow up post from Raymond on
         | this tomorrow. He often does these multipart posts, broken up
         | in rather digestible chunks.
        
       | theandrewbailey wrote:
       | The Old New Thing is such a treasure of insights into how Windows
       | works (or used to work).
        
         | avisser wrote:
         | I love how I read the subject and knew it was a Raymond Chen
         | post.
        
         | ripley12 wrote:
         | It's interesting how The Old New Thing is clearly a passion
         | project for Raymond, but it's also an essential part of Windows
         | documentation. I've run into a lot of situations where
         | Raymond's blog is way more useful than the official docs.
        
         | dixie_land wrote:
         | And Raymond tells the story in a fun and engaging way. I really
         | look forward to a volume 2 of The Old New Thing book (a
         | compilation of his blog entries)
        
       | jayd16 wrote:
       | tl;dr: Yes, but its measured in seconds.
       | 
       | wild.
        
       | EFruit wrote:
       | Raymond's blog always hits a note of morbid fascination. At times
       | it almost feels like schadenfreude. "Neat, but thank God I didn't
       | have to be the one that wrote/discovered that."
        
       | asciimov wrote:
       | The Old New Thing and Dave's Garage (on youtube) have helped me
       | develop an appreciation for the decisions made in Windows
       | development, kinda wish we had this kind of stuff from the Mac
       | and Linux side of things.
        
       | nice_byte wrote:
       | I'm actually quite surprised that it takes _over 30 seconds_ to
       | go through only 300000 items and generate some text with them.
       | Unless the story is from ancient times, that is.
        
         | jayd16 wrote:
         | 300k rows but who knows how many columns.
        
         | rasz wrote:
         | You would think that, but try injecting 5K rows table into html
         | document. My experience in Chrome and modern 4GHz CPU:
         | 
         | '6K rows, 300ms to insert into page on paper (console.time(1);
         | console.timeEnd(1)), but in reality browser freezes for 3
         | seconds (1.8s style, 900ms layout, 300ms update tree). Freezing
         | goes away with position: absolute, but it still takes 3 seconds
         | to show up after .appendChild. I tried replacing Table with
         | Flex divs, even worse speed.'
         | 
         | I imagine I could make Chrome hang for more than 30 seconds
         | with plain old HTML Tables :)
        
         | nolok wrote:
         | 30 seconds seems awefully long indeed and it's probably not on
         | a modern / 2022 computer, but RichText clipboard data in
         | windows does a lot of processing to render in a way that fit
         | context, eg copy a few excel row, paste them in whatsapp webapp
         | and you have a picture, not text.
         | 
         | As a tech user, you quickly learn to fall in love with "paste
         | as raw text", which skips all that and just give you text data.
        
       | bombcar wrote:
       | > over 300,000 rows
       | 
       | Any process you ever enable in code will be pushed to limits you
       | never dreamed possible. This is exactly where discoverability can
       | come into play - someone starts by copying 50 rows and using that
       | to get their job done, and may never realize there are other ways
       | (CSV export, etc).
       | 
       | If code can "recognize" when something like this is being done
       | and provide documentation on other ways, it can help people learn
       | new methods.
        
         | Arrath wrote:
         | > If code can "recognize" when something like this is being
         | done and provide documentation on other ways, it can help
         | people learn new methods.
         | 
         | Now I'm imaging Clippy popping up when you copy a ludicrous
         | amount of data to the clipboard. "You appear to be using a
         | cludgy method, may I suggest something better?"
         | 
         | Of course, I'm guilty of things like this. I have one excel
         | macro that splits data from a giant stream* (one monolithic
         | CSV, actually) into discrete units, graphs them, and then sorts
         | the graphs for printing. It makes a lot of use of the
         | clipboard, and god help you if you try to copy/paste something
         | while the macro is running.
         | 
         | *Giant enough that at one point it grew to where I overran my
         | Int and had to upgrade some of the code to Longs :V
        
           | stormdennis wrote:
           | My chief memory of clippy was that he was modal and that he
           | couldn't answer the question 'make clippy go away', so I
           | could actually do something.
        
           | EvanAnderson wrote:
           | I always wanted Clippy to pop-up when excessive use of
           | VLOOKUP is detected with a message: "It looks like you're
           | trying to implement a relational database in a spreadsheet.
           | May I suggest you get professional help?"
        
             | bombcar wrote:
             | People complain a lot about MS Access, but a easy-to-use
             | relational database is _actually_ a very necessary tool. It
             | 's too bad that Microsoft hasn't figured out how to make it
             | easy to make an access-like system in Excel itself.
        
               | DigiDigiorno wrote:
               | "Easy" is tough when it comes to relational databases.
               | Even Access requires a decent amount of technical know-
               | how when compared to the people who use Excel heavily. In
               | Excel Power Query and the M language are quite powerful.
               | You can combine tables from both your sheets and/or a
               | variety of external sources and create relational views
               | into them. You can then display these views on a sheet.
               | 
               | When I worked for a company where corporate used it, the
               | problem was that people would come to me for help. M is
               | pretty easy to learn so it wasn't a big deal for me. But
               | I am a software dev with database experience, so I'm not
               | sure who the target market is here--it's not the pure
               | Excel users. Like, they wanted tables from a shared
               | folder appended on each other and joined to another
               | table. In pure Power Query you can do this without too
               | much trouble, but you need to know what you are doing.
               | These people have trouble with VLOOKUP already (I mean
               | the string/int problem is unintuitive, so I'm not talking
               | about that), so this is an impossible task for them.
        
               | unyttigfjelltol wrote:
               | It's confusing that Excel supports relational database
               | operations at all. If you want to query the data in Excel
               | it should seamlessly push you into Access rather than
               | partially recreating the same functions.
        
               | csdvrx wrote:
               | > It's confusing that Excel supports relational database
               | operations at all
               | 
               | I'd say it's for the better: sometimes you want to stay
               | in the same tool, and it's the tool's job to interpret
               | your intent.
               | 
               | Imagine you are editing a markdown file and have a
               | picture in your Windows clipboard.
               | 
               | IMHO, the proper action would be to output base64 encoded
               | jpeg data, even if it's "partially recreating the same
               | functions", as it makes a copy-paste of screenshots from
               | say the snipping tool (Win Shift S) seamless.
               | 
               | BTW, github doesn't support base64 encoded jpeg or png
               | data, under the excuse that SVG could have security
               | implications (which is true but not applicable for
               | png/jpg) so don't bother trying it over there...
        
               | EvanAnderson wrote:
               | For sure, re: Access and a relational database tool being
               | important. If somebody ever manages to make a web-based
               | Microsoft Access clone (that actually works) they'll make
               | billions.
               | 
               | It's fun help a "savvy" Excel user understand how a
               | relational database can reduce their byzantine VLOOKUP-
               | based fever dreams into simple joins. Typically if
               | somebody can grok VLOOKUP-fueled nightmares they can grok
               | SQL pretty quickly and will actually appreciate what it
               | can do for them.
        
               | bombcar wrote:
               | >If somebody ever manages to make a web-based Microsoft
               | Access clone (that actually works) they'll make billions.
               | 
               | They did, they called it Salesforce.com
        
               | FastMonkey wrote:
               | I think Salesforce is fine for large companies with teams
               | of sales reps and a well staffed IT department, but it's
               | overkill for most small to medium sized companies with
               | just a few sales reps. If you can run on a creaky set of
               | excel sheets, access would have been a far better and
               | much more flexible solution. With minimal training it
               | could be set up and run by a competent excel user.
               | 
               | Salesforce admin is a pain in the ass. There's mandatory
               | updates 3 times a year that require low level software
               | development expertise in order for the admin to
               | understand what will break, building new functionality
               | essentially requires tens of thousands of dollars of
               | consultant development, and god help you if you want to
               | run a report that involves objects that don't have a
               | direct parent-child relationship.
               | 
               | I'm an analyst, and because I know how a database works,
               | Salesforce stuff gets dumped on my desk all the time. I
               | actively seek out alternative systems for everything it
               | does, and would dearly love to see us drop this eye-
               | watering expense.
        
               | ArnoVW wrote:
               | Airtable?
        
               | DigiDigiorno wrote:
               | There was Access Services in SharePoint but it was
               | depreciated a few years ago. Unfortunately there are some
               | very large companies that use Access in a shared drive
               | instead. They make daily backups just in case there is
               | data corruption.
        
               | stormdennis wrote:
               | 'just in case there is data corruption'
               | 
               | In my experience that was guaranteed if any of the
               | clients connected other than by ethernet.
               | 
               | I've not done it but I understand that it's not difficult
               | to have an Access front end for a SQL Server backend
               | rather than the default mdb or accdb backend.
               | 
               | All being Microsoft products the migration to SQL server
               | is easy as I understand it.
               | 
               | I find it hard to understand why large companies would
               | not adopt this approach.
        
               | EvanAnderson wrote:
               | Access files are definitely super-fragile. That's not
               | isolated to Access, though. Any time a file sharing
               | protocol is used to host a database-- particularly with
               | multi-user locking semantics-- I get the willies.
               | 
               | I've done more "development" of Access-based applications
               | over the years than I'd care to admit and, as a menu-
               | driven front end for interaction with a client/server
               | RDBMS (SQL Server, Postgres, etc) I think it's good cheap
               | solution. Visual BASIC for Applications (VBA) can even do
               | some powerful (and arguably ill-advised) stuff like
               | directly calling Win32 APIs. It's an awesome prototyping
               | tool in my experience.
               | 
               | The typical Access solution I see in large corporate
               | environments is something knocked-together by non-IT
               | people. Once it gets to the level of needing to be
               | upsized to a client/server RDBMS back-end the "real" IT
               | department comes in and demands a purpose-built solution.
               | Usually bureaucracy, disdain for Access, licensing costs
               | for the client/server RDMS, taking away file servers,
               | etc, end up killing it.
        
             | Arrath wrote:
             | Oh you must have seen my accounting department's
             | 'transaction register' which is a...
             | 
             |  _checks latest_
             | 
             | 64mb spreadsheet that amounts to one gigantic, ever slower
             | pivot table.
        
               | Optimal_Persona wrote:
               | One department at my agency shrunk an ~80MB Excel sheet
               | down to ~1-2MB by using the .xlsb (Excel Binary) file
               | format, and it sped up quite a bit. But point taken, once
               | this is the single source of truth for biz-critical data,
               | Excel is not the right storage format.
        
           | ody4242 wrote:
           | There are some exotic scenarios, where copy-paste is the
           | good(fast) solution. For example, one of my clients can be
           | accessed via a VPN. Once I'm on the VPN, I have to start
           | their VDI. Inside the VDI, I need to start another VPN, that
           | then allows me to open a Putty session to a bastion host,
           | that I can use to reach my destination cluster. Believe it or
           | not, they don't want to make it simpler.
           | 
           | Copy/paste works flawlessly through the VDI into the putty
           | session, so I usually just uuencode my blob, and copy it to
           | destination cluster and uudecode there, instead of uploading
           | the file to the VDI, then pscp to the bastion host, and then
           | scp to the destination cluster. (I know of zmodem, port
           | forwarding and such, none of this is allowed...)
        
             | ntoskrnl wrote:
             | That sounds horrific. I wonder if anyone has built a TCP
             | tunnel that works over shared clipboard? :)
        
               | sandermvanvliet wrote:
               | Not sure but I've made something more ugly.
               | 
               | Once upon a time at $workplace we had a production and
               | development LAN and we had two PC's sitting on our desks,
               | one for prod and one for dev.
               | 
               | Now there was a special SMB share to move stuff between
               | the two networks but trying to copy something from one Pc
               | to the other was tedious.
               | 
               | So of course I wrote a magic clipboard utility that used
               | a file on that SMB share as the clipboard "storage".
               | Running the utility on both PCs allowed me to use copy-
               | paste between the two PCs...
        
               | funcDropShadow wrote:
               | I have once worked for a customer where other freelancer
               | had developed a special proxy. The customer required
               | working in a hermetically closed vpn environment even to
               | access the test systems. Whitelisting a single web page
               | cost an unreasonable amount of budget and took days to
               | weeks. Therefore someone had decided to run the vpn
               | inside a virtual machine, and developed an http proxy
               | that consisted of two processes, one running inside the
               | VM and one outside. Now, you gan guess how they exchanged
               | requests and responses. That whole setup was surprisingly
               | usable.
        
             | johnwalkr wrote:
             | copy/paste really is a great tool. I bought a Windows
             | gaming PC during the pandemic, and my other systems are
             | Macs. I started to use barrier (a multi-platform software
             | KVM-like keyboard and mouse sharing thing) and was
             | pleasantly surprised to learn that it shares the clipboard
             | across all of my PCs, and my Macs in turn also share the
             | clipboard to my iphone. This works in both directions. It's
             | convenient to the point that using multiple PCs with
             | multiple operating systems is barely different than using
             | one PC with 2 monitors. I travel a lot for work and this
             | feature also lets me use my personal laptop as a slightly
             | limited second screen for my work laptop. Total gamechanger
             | for free.
        
           | prometheus76 wrote:
           | Have you looked into powerpivot in Excel? I learned how to
           | use it, then eventually moved into using Power BI, and now
           | that's what I do for a living. Powerpivot unlocks so much
           | potential in Excel, and it allows you to have millions of
           | rows of data and work with it seamlessly. It also allows you
           | to create relationships between tables instead of using
           | vlookups. If you haven't tried it, look at some introductory
           | videos on youtube. It will blow your mind.
        
             | Arrath wrote:
             | I haven't! If I need to revive this particular bit of
             | shameful spaghetti code, I'll look into it, thanks!
        
         | geraldcombs wrote:
         | We (Wireshark) ended up doing this when someone tried to load a
         | capture with 54 million packets:
         | https://gitlab.com/wireshark/wireshark/-/issues/16908
        
         | babypuncher wrote:
         | Some video games have tutorial systems similar to this. They
         | will recognize when players are struggling with a certain
         | mechanic or system, and pop up a relevant tutorial. i.e. if a
         | user is trying and failing to jump across a gap, they probably
         | forgot to use their hover boots.
         | 
         | This can get annoying though if the user is deliberately doing
         | something that ends up triggering these messages.
        
         | treeman79 wrote:
         | Filed a bug report once. App crashes when font is more then
         | 13,000 points.
         | 
         | There was a long discussion on memory management before they
         | just stuck a max size on it.
        
           | sudosysgen wrote:
           | When I was a dumb kid, with my friends, we'd inject 100k
           | point unicode fish into the chats of online games and crash
           | every single client. Eventually they encrypted their chat
           | protocol instead of just removing HTML support and doing
           | sanitation. We eventually figured it out but it was exam
           | season so we dropped it
        
         | cnity wrote:
         | This is a chicken and egg problem. This limit seems impossibly
         | high because users lack the expectation they can perform this
         | action, because designers of software don't expect users to
         | perform this action, because users lack the expectation they
         | can...
         | 
         | I disagree with sibling comments that copy/paste is a hacky
         | solution. It's a very natural one for lots of users and there's
         | no actual fundamental reason not to be able to accommodate it.
        
         | markmark wrote:
         | Visual Studio used to (or maybe still does) have an issue where
         | it wouldn't hit breakpoints after the 65,536th line in a source
         | file. It wasn't something I ever encountered, I just came
         | across the issue in the docs somewhere, but I pity the person
         | that ran into it.
        
         | tomcam wrote:
         | > Any process you ever enable in code will be pushed to limits
         | you never dreamed possible.
         | 
         | Not me. And that's not a brag. It is probably not a productive
         | way to think using modern toolsets. But in my world, if you can
         | copy a few things, you should definitely expect someone to copy
         | a shitload of things or at the very least, document clearly and
         | with rich error messages what went wrong.
         | 
         | Likewise, I tend to get nervous when I can't explicitly handle
         | out of memory conditions, and the problem is I'm a Go
         | programmer. It kind of bothers me that there's no standard way
         | to deal with that on my end with built-in data structures such
         | as maps and strings. This is probably sheer paranoia because
         | most modern systems have plenty of memory... But it still
         | leaves me uneasy.
        
         | [deleted]
        
       | sprremix wrote:
       | > This is known as clipboard delay-rendering
       | 
       | Aha, so that's why Word[1] just explicitly asked me if I want to
       | save the current copied image before quitting. It's probably
       | asking before loading something big into memory?.
       | 
       | [1] https://i.imgur.com/sNfE3Be.png
        
       | dragontamer wrote:
       | The Windows Clipboard, for all of its problems, remains one of
       | the easiest program-to-program communication methods to use in
       | modern GUIs.
       | 
       | I can take a screenshot of my Firefox with "PrtScn" button
       | (moving a bitmap of the page into the Clipboard), paste it into
       | Microsoft Paint, edit it a bit, and then copy/paste that into my
       | Discord chat screen for commentary.
       | 
       | --------
       | 
       | Yes, Linux / *Nix users have pipes and great text processing
       | tools. Yes, Powershell has interesting objects that can be passed
       | round. But practically speaking? Most of my "inter-process
       | communications" is over this silly "Clipboard" Windows has, and
       | it works way better than it probably should.
        
         | cecilpl2 wrote:
         | On Windows, it's now faster/easier to use the built in
         | Snip+Sketch tool (Win + Shift + S).
         | 
         | It does instant rectangular selection, then pops up a simple
         | editor which you can then copy/paste anywhere you'd like.
         | 
         | I have Win+Shift+S bound to a mouse chord, as well as copy and
         | paste, so I can actually paste an arbitrary rectangle of my
         | screen without touching the keyboard.
        
         | [deleted]
        
         | cyral wrote:
         | It's also great when you copy some text from Outlook and it
         | pastes it into discord as an _image_ of the text. I believe it
         | has been fixed now but that was happening to me for a while.
        
         | yardshop wrote:
         | Also really handy sometimes is Win+PrintScreen, which puts the
         | screen image on the clipboard, and also saves it to a numbered
         | file in your Pictures\Screenshots folder. If things are
         | happening fast and you don't want to paste and manipulate each
         | screen shot, this lets you save several in a row to go back and
         | work with later.
        
         | com2kid wrote:
         | I've had the pleasure of looking at the Windows source code for
         | the clipboard.
         | 
         | Insanely well engineered. It can perform miracles of computing.
         | It damn well has to.
         | 
         | > I can take a screenshot of my Firefox with "PrtScn" button
         | (moving a bitmap of the page into the Clipboard), paste it into
         | Microsoft Paint, edit it a bit, and then copy/paste that into
         | my Discord chat screen for commentary.
         | 
         | All without you worrying about supported image formats or color
         | space encodings! It is insane! Copy from Firefox and then paste
         | into a program that expects 16bit color and it'll probably
         | work. The clipboard stores data in so many duplicate formats
         | and can convert between so many formats, it is nuts.
        
         | pvg wrote:
         | On the current macOS, the screenshot can be edited/annotated
         | when it's previewed on the mac or on a nearby iPad where it
         | automagically appears (with edits propagating back to the mac).
         | 
         | Something similar is available in the more modern Windows
         | 'snipping tool' feature (win-shift-s) but without the tablet
         | magic.
        
         | ryandrake wrote:
         | I haven't been keeping up with the Windows world. Does
         | Microsoft provide any safeguards or tools for the user to limit
         | access to the clipboard? The clipboard was introduced in the
         | good ol' days when you could basically trust the applications
         | running on your computer. Nowadays, third party (and for those
         | of us more paranoid) first party apps need to be considered
         | attackers. The clipboard is a juicy target that often contains
         | sensitive data I'm sure most apps would like to gobble up and
         | exfiltrate. I know iOS and Android both are starting to
         | introduce restrictions on mobile apps' use of the clipboard.
         | Has this made it into the Windows desktop world?
        
           | pjc50 wrote:
           | The rules are completely different if you're running
           | "appstore" apps, which actually have some kind of sandbox.
           | 
           | If it's a regular win32 app, then it has access to all your
           | filesystem (except UAC bits), can read and post keystrokes to
           | other windows, and indeed can just straight up inject code
           | into other processes.
        
             | Melatonic wrote:
             | Not true anymore - there are process isolation modes you
             | can enable in Windows 10 as well as kernel isolation where
             | it runs core processes in a VM essentially. And there is
             | also protected folder access.
        
           | gruez wrote:
           | Windows isn't sandboxed so any per-program restrictions is
           | pretty much pointless because it'll be trivial to bypass.
        
             | 323 wrote:
             | Regular apps, Windows Store apps are sandboxed. Some of
             | them are quite popular (eg: Netflix).
        
         | jjice wrote:
         | For screenshots and edits, I have to say that I love MacOS's
         | tools. CMD-Shift-4 to capture a screen region, click on it in
         | the bottom right, edit it right there, and click 'Done'. Their
         | editing tools are also super intuitive there. Honestly my
         | favorite MacOS tool and I'd love a cross platform equivalent.
        
           | nonfamous wrote:
           | FWIW the process is about the same in Windows. The only
           | difference is the keyboard shortcut is Windows-Shift-S.
        
             | wongarsu wrote:
             | The only real difference is that Windows introduced the
             | simple way only fairly recently (7 years ago with Windows
             | 10), so lots of people are still used to doing it the old
             | way.
        
         | magicalhippo wrote:
         | Even better, you can copy an attachment in a mail in Outlook,
         | and paste it into an application running on another computer
         | via RDP. The file will be copied over without the applications
         | knowing any better.
         | 
         | We use this so users can attach invoices and other documents
         | they've received through mail to orders in our application.
         | Users typically run Outlook on their laptop/PC, but our
         | application as a published application.
         | 
         | We rely on Excel exposing the data in an XML format on the
         | clipboard to reliably import data from Excel. Same for
         | Open/LibreOffice. Without it it's impossible to handle cells
         | which contain both the quote character and newlines, due to the
         | way Excel formats plaintext.
         | 
         | We don't want to import the whole file, because the users
         | typically only need to import parts of the spreadsheet. This
         | saves us from writing a complex UI to select the data to
         | import.
         | 
         | And FWIW, I've used that with >100k rows of data.
        
           | Melatonic wrote:
           | Yea this is a super underrated feature - copy and paste
           | through RDP is awesome. Although in some cases you would
           | probably want to of course disable that for security reasons.
        
           | yardshop wrote:
           | It works several layers deep too. My typical WFH scenario
           | these days is:                   home PC ->          RDP to
           | work laptop at home ->          VNC to work network ->
           | RDP to work desktop ->          RDP to other VMs and PCs at
           | work
           | 
           | I can copy text or a file or a screen shot at any level and
           | paste at any other level. Pretty amazing.
        
         | Blikkentrekker wrote:
         | What you describe also works on X11 and probably what MacOS
         | uses too.
         | 
         | I'm not sure why it would be impressive or unusual. The ability
         | to store arbitrary data on the clipboard with metadata that
         | describes what data it is, such as an image file, or an audio
         | file, is very old.
        
           | dragontamer wrote:
           | > What you describe also works on X11 and probably what MacOS
           | uses too.
           | 
           | Except its no where near as smooth or universal as in
           | Windows. In Linux, you have to worry about KDE programs vs
           | GNOME programs having different clipboards, for example.
           | 
           | Its also why compatible suites of programs (ie: Adobe) can be
           | so useful when those custom formats come into play. Adobe can
           | copy/paste layers from Photoshop and send them over to other
           | programs. If the photoshop layer isn't understood, it seems
           | to become a Bitmap, which works when I'm on a VBulletin forum
           | over in Firefox land.
           | 
           | ---------
           | 
           | Copy/paste works on files / file-managers, images, text,
           | HTML. Yes, any OS could do the same thing, but they largely
           | don't in my experience.
        
             | moxvallix wrote:
             | Nah man, clipboard on Linux, mainly KDE, is really good.
             | KDE splits out selected text, and ctrl+c text, into
             | separate clipboards, allowing for some really good
             | workflows.
             | 
             | Selecting text and middle clicking is so much faster than
             | ctrl+c, ctrl+v. Having the two separate, allows you to
             | essentially copy two separate things at once, and paste
             | them separately, which is great for filling out forms.
             | 
             | Also, KDE provides an absolute gem of a clipboard manager,
             | which stores all recent copies in to a list, from which
             | entries can be browsed in order to recopy some text that
             | you may have copied a while ago. IDK where you got the idea
             | that Gnome apps have a different clipboard, as I have never
             | experienced that. Maybe that is an old thing? Definitely
             | not how it is now, thats for sure.
             | 
             | Copy/paste works on files / file-managers, images, text and
             | HTML. This is not a Windows only experience. In fact, the
             | clipboard manager even has little file icons, and image
             | previews, for copied objects.
        
               | SrZorro wrote:
               | > Also, KDE provides an absolute gem of a clipboard
               | manager, which stores all recent copies in to a list
               | 
               | In windows 10 and up, win + v to see (and the first time,
               | enable) the clipboard history selector
        
               | BenjiWiebe wrote:
               | Yes I love this Windows 10 feature.
               | 
               | Note that KDE has had it pre Windows 10 though.
        
               | eqvinox wrote:
               | > KDE splits out selected text, and ctrl+c text, into
               | separate clipboards, allowing for some really good
               | workflows.
               | 
               | Just for completeness & correctness: that's an X11
               | feature, not related to KDE, and predates KDE by several
               | years. I can't easily find the history of it, but this
               | Keith Packard paper[0] on it is dated 1990 so it's
               | necessarily older than that...
               | 
               | [0] http://keithp.com/~keithp/talks/selection.ps
               | 
               | (pg. 5, "4.1. Selection names" - PRIMARY, SECONDARY,
               | CLIPBOARD. I don't think SECONDARY is used much these
               | days.)
        
             | Blikkentrekker wrote:
             | > _Except its no where near as smooth or universal as in
             | Windows. In Linux, you have to worry about KDE programs vs
             | GNOME programs having different clipboards, for example._
             | 
             | I am no sure where you get this idea. The clipboard is an
             | X11 shared resource and any program taking control of it
             | removes what any other had on it before.
             | 
             | > _Its also why compatible suites of programs (ie: Adobe)
             | can be so useful when those custom formats come into play.
             | Adobe can copy /paste layers from Photoshop and send them
             | over to other programs. If the photoshop layer isn't
             | understood, it seems to become a Bitmap, which works when
             | I'm on a VBulletin forum over in Firefox land._
             | 
             | The same exists on X11, programs can define custom metadata
             | and define a hierarchy of different metadata and associated
             | data on the clipboard and any application can decide for
             | itself which formats it understands and which it does not.
             | 
             | I've personally built software that puts images on
             | clipboards, and falls back with uris to that image if
             | direct images not be supported by whatever reads it.
        
             | partido3619463 wrote:
             | The conversion behavior you describe is also what happens
             | in MacOS.
        
             | mahkoh wrote:
             | >In Linux, you have to worry about KDE programs vs GNOME
             | programs having different clipboards, for example.
             | 
             | I don't worry about this on linux because it's not the
             | case.
             | 
             | I suppose if I were on windows I would have to worry about
             | legacy programs that only understand UCS-2 not being able
             | to talk to modern programs that only understand UTF-8.
             | 
             | >Its also why compatible suites of programs (ie: Adobe) can
             | be so useful when those custom formats come into play.
             | Adobe can copy/paste layers from Photoshop and send them
             | over to other programs. If the photoshop layer isn't
             | understood, it seems to become a Bitmap, which works when
             | I'm on a VBulletin forum over in Firefox land.
             | 
             | I'm able to paste images from GIMP, Krita, and Thunar into
             | forums just fine.
        
             | jrochkind1 wrote:
             | MacOS clipboard is also pretty good, I'm often pleasantly
             | surprised by it. I don't use Windows enough in the right
             | ways to compare them, I wouldn't be shocked if Windows is
             | even better.
             | 
             | But even if old, it's still notable that such an old
             | concept/technology works so well, and there are few newer
             | inter-process communication methods that work as reliably
             | or with as good UX!
             | 
             | Who invented the "clipboard", Xerox PARC? No, wikipedia
             | just credits two individuals, Pentti Kanerva and Larry
             | Tesler .
        
               | Aloha wrote:
               | They're about equal, MacOS generally is better about
               | letting my copy a thing in one application and paste the
               | whole object in another. Windows however has RDP, which
               | I've used as a file transfer mechanism by base64 encoding
               | files, I thought about writing software that would use it
               | as a half duplex communications channel.
        
               | jrochkind1 wrote:
               | Mac also has something that lets you copy/paste clipboard
               | across machines (including between iOS and MacOS), but I
               | don't know how it works technically and haven't actually
               | used it myself.
               | 
               | https://support.apple.com/guide/mac-help/copy-and-paste-
               | betw...
        
         | lemoncookiechip wrote:
         | Unrelated, but you can actually use Firefox's own screenshot
         | function which is far more robust than PrtScn, allowing you
         | crop the image how you want (including snap to element), you
         | can also save to clipboard or download it for further editing
         | or storing. The key-shortcut is CTRL+LSHIFT+S.
        
           | enlyth wrote:
           | I find WIN + SHIFT + S to be superior, because it is not
           | limited to the browser window, automatically copies to the
           | clipboard, and you can choose to annotate it if you want
        
           | jwagenet wrote:
           | I mean, if you are in Windows already you should be using
           | Snip at least since Win7. It has cropping, window snap, and
           | basic annotation, in addition to capture save and copy.
        
         | banana_giraffe wrote:
         | It's cute just how old the concept of the Windows Clipboard is.
         | 
         | The basic APIs were there from the beginning in Windows 1.0,
         | including multiple clipboard formats, application specific
         | formats, and the ability to register for clipboard changes.
         | More standard formats have been added over the years, but it
         | still supports some ancient formats, like Software Arts' Data
         | Interchange Format.
        
           | ziml77 wrote:
           | I recently looked at the API docs for Windows 1 because I
           | wanted to see if ExitWindows was there from the start (since
           | that naming really only makes sense if Windows has something
           | to exit to). It wasn't there until Windows 3, but I was
           | surprised to see just how far back many familiar functions
           | go. I expected the API to be far smaller than it was for 1.0
        
             | jwilk wrote:
             | I'd love to get my hands on old Windows API docs. Are they
             | available online somewhere?
        
               | banana_giraffe wrote:
               | Some are, here's the Win 1.0 and 2.0 SDK documentation:
               | 
               | https://www.os2museum.com/wp/windows-history/windows-
               | library...
        
         | pjc50 wrote:
         | > "inter-process communications"
         | 
         | Way back in the 90s, it was possible to put any (+) document
         | inside any sufficiently aware app or document with OLE ("object
         | linking and embedding")
         | 
         | The (+) indicates that there were a lot of terms and conditions
         | applying to this, but you could actually just put an excel
         | spreadsheet in a word document, and it would run a small copy
         | of excel inside word. This is why the original word save format
         | is so horrendous - it's serialized binary objects.
        
           | com2kid wrote:
           | OLE is an awesome tech that I am sad isn't more widely used.
           | The idea of being applications being portable toolboxes that
           | can be embedded inside of other applications is just so cool.
           | I remember embedding, IIRC, Print Shop Pro media inside of
           | Word and when I clicked on the graphics the PSP UI appeared!
           | Well after 10-20 seconds of hard drive thrashing it appeared,
           | and then operated at about 5 fps.
           | 
           | Cool idea though!
        
           | pkaye wrote:
           | I think OLE used the compound file format which was modeled
           | after a FAT file system image.
           | 
           | https://en.wikipedia.org/wiki/Compound_File_Binary_Format
        
         | MikeSchurman wrote:
         | I've found the clipboard to be a highly flexible tool, that
         | seems under-used. As an example, I've extended my game engine
         | editor to draw any position in 3d that I have in the clipboard.
         | So when problems happen and are displayed in the logs, I select
         | the log, copy to clipboard, boom, position drawn.
         | 
         | This idea has a lot of legs IMO.
        
           | dragontamer wrote:
           | There was a browser based game called "Utopia" in the 00s
           | that was reasonably popular. Someone wrote a tool where you'd
           | copy/paste your kingdom homescreen, and get all sorts of
           | calculations / predictions.
           | 
           | It was one of the easiest-to-use calculators I've ever seen.
           | Just enter your webpage to play the game, Ctrl-A (select-
           | all), Ctrl-C (copy), and bam, the Utopia-program would
           | instantly analyze your kingdom and provide advice.
           | 
           | Just all off of the HTML-copy that Clipboard supports.
           | 
           | ------------
           | 
           | Windows developers "know" the clipboard is one of the most
           | important inter-process communication structures of the
           | entire system, and have known for years. Its probably one of
           | the Win32 API's biggest advantages, no joke.
           | 
           | The shear amount of creative solutions I've seen from
           | clipboard manipulations is outstanding.
        
             | RajT88 wrote:
             | Since Windows 7 or so, I've noticed more and more instances
             | where you ctrl+C and the clipboard doesn't update. I had a
             | chat with a Windows PM on it opportunistically a while
             | back.
             | 
             | It turns out, more and more applications are locking the
             | clipboard and holding onto the lock inappropriately. Enough
             | that there's a particular telemetry watcher for this
             | condition for MSFT to get an idea on who the guilty parties
             | are.
             | 
             | Everyone has had it happen - I notice it when colleagues
             | are in a rush and send me something they didn't mean to
             | send (because their clipboard didn't update). I don't know
             | who the guilty parties are (since that telemetry is
             | encrypted, and can't be inspected), but I sure hope someone
             | is knocking down some doors to address the problem.
        
               | bennysomething wrote:
               | Genuine question, why is it even possible to lock the
               | clip board?
        
               | RajT88 wrote:
               | I have tried to track this down - it seems like at some
               | point it was not possible. My guess is Vista is when the
               | lock was implemented. I've come up blank repeatedly.
               | 
               | I am sure Raymond Chen knows. Looks like comments are
               | allowed on his blog too!
        
               | ectopod wrote:
               | An application doing a paste needs to query the available
               | clipboard formats and then ask for the data from one of
               | them. This wouldn't work reliably if other applications
               | could simultaneously change the clipboard. So the
               | OpenClipboard API locks the clipboard and applications
               | need to remember to call CloseClipboard.
        
               | asveikau wrote:
               | This sounds to me like it's probably a proxy for the rise
               | of GC languages. C#, which I reference because it's
               | popular for windows desktop apps, has IDisposable and
               | using() which helps a lot, but isn't mandatory. If you
               | don't do something like this and there isn't memory
               | pressure, there are low odds of a handle or resource lock
               | being released.
        
               | [deleted]
        
               | bombcar wrote:
               | A weird one I've noticed with the clipboard on the Mac,
               | is that the "rich text" clipboard and the "plain text"
               | one seem to be able to get out of sync. This is most
               | noticeable to me when trying to paste text into some
               | dialog boxes in Microsoft Word.
        
               | formerly_proven wrote:
               | One guilty party: some versions of the RealVNC client
               | randomly lock the clipboard.
        
               | ntoskrnl wrote:
               | Coming from the other side, most apps don't check the
               | winapi error code when copying text. One app I use
               | (notepad2 maybe?) at least throws up a tiny "Error"
               | dialog box when it fails.
               | 
               | I configured my clipboard manager to make a crinkly paper
               | noise when an app copies, so at least I have some
               | feedback when it fails.
        
               | RedShift1 wrote:
               | Oooh so that's what that is. I've had it happen numerous
               | times where I was absolutely sure I pressed CTRL+C yet
               | the clipboard was empty. I now use CTRL+X and CTRL+Z just
               | because of that.
        
               | RajT88 wrote:
               | That's interesting - that Ctrl+X behaves differently. It
               | shouldn't right?
               | 
               | But you have found that it helps?
        
               | RedShift1 wrote:
               | It helps because there is visual feedback so you're sure
               | you don't have to go back to the original program and do
               | the copy again. Plus sometimes your original program
               | forgets your selection, with CTRL+X you're sure it's on
               | the clipboard and won't have to return.
        
           | jwandborg wrote:
           | IIRC factorio's blueprints are represented, or have one
           | representation, as base64-encoded gzipped JSON on the
           | clipboard (with a version byte as prefix in the b64 form,
           | double-IIRC), meaning you can copy/paste blueprints between
           | the game and anything other that accepts text.
        
             | bombcar wrote:
             | Hearthstone added something similar for decks (even made it
             | human readable):                 ### Starting Party       #
             | # Cariel Roame       #   - Tome of Light 4       # Xyrella
             | #   - Robes of Purity 2       # Rokara       #   - Helm of
             | Inspiration 1       # Murky       #   - Time to Krill 3
             | # Millhouse Manastorm       #   - Arcane Powder 1       #
             | Deathwing       #   - Heart of Unliving 3       #        CO
             | +cmQQSDlN0YXJ0aW5nIFBhcnR5GAEiRQoJCBIQiwEYICAACgkIExDKARgjI
             | AAKCQgLEIgBGAsgAAoLCLgCEOMCGLIEIAAKCAgOEB8YFCAACgsIqgIQygIY
             | kgQgACgA       #        # To use this deck, copy it to your
             | clipboard and create a new deck in Hearthstone
        
         | analog31 wrote:
         | I believe Windows did a lot of things right by just keeping
         | things simple for developers. I use the clipboard to transfer
         | large blobs of data from one program to another when doing
         | exploratory programming -- it's a lot quicker than creating
         | file formats for everything. Of course there's the risk of
         | losing it in the process.
         | 
         | Another under-appreciated Windows feature is how they implement
         | drag-and-drop apps. When you drag a file into an app icon, it
         | just stuffs the file path into the command line arguments and
         | runs the app. In contrast, though MacOS introduced drag-and-
         | drop, actually implementing it in System 7 was a huge complex
         | chore.
        
       | 867-5309 wrote:
       | I find the size always seems to run run parallel with my patience
       | at that given moment
        
       | ErikAugust wrote:
       | Wouldn't it be nice if it threw an error, and didn't just return
       | NULL?
        
         | bsnal wrote:
         | If you get NULL, you are supposed to call GetLastError to get
         | information on what happened.
        
         | Akronymus wrote:
         | Itd be nice if the proviser were to show a dialog that a copy
         | was requested but couldnt be provided. Altough, dunno what a
         | good message for that would be.
        
           | hackmiester wrote:
           | Very old school windows apps like SecureCRT display semi-
           | helpful messages for this. Better than a silent failure
           | anyway.
        
       | jeffwask wrote:
       | The world is run by one giant excel spreadsheet
        
         | cgrealy wrote:
         | The world's mail definitely is!
         | 
         | https://youtu.be/dHhkNwE7pr8
        
         | pbar wrote:
         | It's a spreadsheet world and we're just living in it ;)
        
       | Kipters wrote:
       | I must admit, just by reading the title and the domain on HN's
       | homepage I was dead sure it was a Raymond Chen post
        
       | capableweb wrote:
       | > Next time, we'll see what we can do to extend this timeout.
       | 
       | That, somehow, seems like the wrong conclusion. Why not try to
       | solve the problem of Excel taking longer than 30 seconds to
       | export a RTF table?
        
         | kencausey wrote:
         | Given the range of computers on which Excel is likely to be
         | running that seems like a complete non-starter. There will
         | always be cases that take longer than X no matter what you
         | choose for X.
        
           | capableweb wrote:
           | Yeah, why not display a "Exporting..." dialog then that the
           | user themselves can cancel if they think it's taking too
           | long? Extending the timeout to X won't solve anything.
        
             | elpocko wrote:
             | When you press Ctrl+V, the target window is focused.
             | Forcibly switching back to Excel to show this dialog seems
             | weird and confusing to me.
        
               | glenneroo wrote:
               | Then why not show a system dialog similar to copy/move
               | files dialog after e.g. 5 seconds of waiting for a copy-
               | to-clipboard operation?
        
               | hackmiester wrote:
               | Actually, now that you point out that this could be done,
               | I'm surprised it wasn't.
        
         | seritools wrote:
         | Cool, now it's optimized and it manages to export up to a
         | million lines in 30 seconds. What do you propose to do when the
         | next customer wants to copy 1.5 million lines?
        
           | hermitdev wrote:
           | > What do you propose to do when the next customer wants to
           | copy 1.5 million lines?
           | 
           | Thankfully, that can't happen :). XLSX has a row limit of
           | 1,048,576 rows.
           | 
           | In all seriousness, I don't have an answer for you other than
           | that the developer that's looking to shove >1M excel rows
           | around should find a better solution than the clipboard. I've
           | done more than my fair share of work pushing excel
           | spreadsheets around (and I've even worked on Excel add-ins).
           | There are plenty of performant ways of accessing large
           | volumes of Excel data, none of them involve the clipboard.
           | Most of them even work on non-Windows platforms.
           | 
           | The arbitrary row & column limits in Excel (XLS was pretty
           | small, XLSX is quite a bit bigger, but still arbitrary) are
           | annoying and I cannot begin to tell you how many hours over
           | the years I've wasted due to this limitation or Excel
           | silently truncating large CSV files on import.
        
             | londons_explore wrote:
             | Indeed - it would be very possible to make a version of
             | Excel which can deal with infinite-sized sheets by leaving
             | most of the data on disk and only loading a few screenfulls
             | at once.
        
       | [deleted]
        
       ___________________________________________________________________
       (page generated 2022-06-08 23:00 UTC)