Giter VIP home page Giter VIP logo

Comments (6)

tznind avatar tznind commented on June 23, 2024 2

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.

MaciekWin3 avatar MaciekWin3 commented on June 23, 2024 1

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.

BDisp avatar BDisp commented on June 23, 2024

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.

MaciekWin3 avatar MaciekWin3 commented on June 23, 2024

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.

BDisp avatar BDisp commented on June 23, 2024

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.

So in this case just use the following:

Clipboard.Contents = "your text";

from terminal.gui.

BDisp avatar BDisp commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.