cmd2
cmd2 copied to clipboard
Consider implementing/documenting a way to disable clipboard feature
It would be nice to have a supported way to disable clipboard feature altogether. Purpose: Bypass checks and save a few milliseconds startup time (up to 400ms on systems I have to support)
@alhernau This is a good callout since end users tend to care a lot about performance and startup time. I like this idea for a feature request. We can look into it. But please feel free to submit a PR.
I wonder if we could make this a load-on-first-use thing so it doesn't impact startup time.
I have a potential solution for this on the clipboard branch.
If the goal is to improve startup time, what if, instead of yet another thing to configure, we defer loading anything related to the clipboard until something is called that uses it. Take the 400ms hit at that the point when something needs to use the clipboard.
andd ... I just realized I'd said that months ago.
The clipboard branch now has a useful solution to this problem. It both adds an allow_clipboard attribute and initialization parameter, but also defers the pyperclip initialization until the user attempts to direct output to the clipboard.
This has been added and will be included in the next release of cmd2.