Comments (6)
I think he is saying that once printscreen is used before app starts then copy to clipboard fails from then on - not that the clipboard text is being overwritten.
i.e. that the code which checks whether clipboard is working on OS Windows is bugged and is saying there is no clipboard implementation when really there is.
Basically the constructor for WindowsClipboard is asking OS if there is text data available to paste. What it should be doing is asking windows if clipboard functionality exists at all. So should just be:
public WindowsClipboard ()
{
IsSupported = true;
}
What code should probably be
The real issue here is that IsSupported is set once only when the driver is created then used like a way to decide whether the user can copy/paste from that point on:
public WindowsDriver ()
{
WinConsole = new WindowsConsole ();
clipboard = new WindowsClipboard ();
isWindowsTerminal = Environment.GetEnvironmentVariable ("WT_SESSION") != null;
}
from terminal.gui.
I think he is saying that once printscreen is used before app starts then copy to clipboard fails from then on - not that the clipboard text is being overwritten.
Yes, that is what I meant
from terminal.gui.
I think there is no bug here. From what I understand, you copy text to the clipboard and after the reboot the clipboard is reset and it does not contain any value. The other situation is that you copy text to the clipboard and then take a screenshot and of course the text is no longer on the clipboard but the screenshot is. If you try to do the same with Notepad you also get the same result, because the image is not compatible with text.
I haven't really tested it yet, but normally when I use the clipboard it always uses the most recent content, but if it's possible to get a list of the clipboard content so we can select what we want, that's new to me.
from terminal.gui.
From what I understand, you copy text to the clipboard and after the reboot the clipboard is reset and it does not contain any value. The other situation is that you copy text to the clipboard and then take a screenshot and of course the text is no longer on the clipboard but the screenshot is. If you try to do the same with Notepad you also get the same result, because the image is not compatible with text.
You are right. However, what I meant is that, for example, after a PC reboot, when I try to copy text to the clipboard using Clipboard.TrySetClipboardData
, it fails as there is no unicode text there so IsClipboardFormatAvailable
and IsSupported
property both return false. I think the intended behavior when the clipboard is empty is to copy text from Terminal.Gui app to the clipboard. This is the use case that I am facing in my app.
from terminal.gui.
You are right. However, what I meant is that, for example, after a PC reboot, when I try to copy text to the clipboard using
Clipboard.TrySetClipboardData
, it fails as there is no unicode text there soIsClipboardFormatAvailable
andIsSupported
property both return false. I think the intended behavior when the clipboard is empty is to copy text from Terminal.Gui app to the clipboard. This is the use case that I am facing in my app.
So in this case just use the following:
Clipboard.Contents = "your text";
from terminal.gui.
Now I got it, sorry. I was doing a print screen after open the Terminal.Gui. Now opening the app after the print screen I confirm now that this is bugged for sure.
from terminal.gui.
Related Issues (20)
- DimAuto equality HOT 3
- Slider<> strange behaviour of Text property HOT 3
- v2: Button alignment in MessageBox is no longer centered HOT 3
- Allow to set Contents to dirty to just refresh the screen. HOT 2
- Terminal.Gui 1.17.0 Throws System Exception in Application.Run(dialog) HOT 17
- v1 CursesDriver isn't updating the buffer on the UpdateOffScreen method.
- How to "hide" views from layout? HOT 12
- Application.Run<T> is broken by not calling Init before initializing T.
- Add an example for CommunityToolkit.MVVM
- V2: TextField numeric input not working on non-Windows platforms HOT 5
- Disable borders on a MenuItem HOT 4
- v2 crashes on run with missing dependency JetBrains.Annotations HOT 9
- When adding more than one Window + TextView together with a MenuBar, the displayed text changes to the text of the first added Window HOT 4
- Create custom commands/key bindings HOT 3
- Mouse is broken in v2 HOT 2
- v2: Big performance impact on ListView/ComboBox's that contain a lot of items HOT 3
- Multiple views with the same `HotKey` should be supported
- Nuget.Config for v2 can behave badly for local CLI builds, plus some minor QoL stuff for Terminal.Gui.csproj and the solution
- Build .... oddities...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminal.gui.