Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to copy into input fields? #174

Closed
DavidLazarescu opened this issue Aug 6, 2021 · 2 comments
Closed

A way to copy into input fields? #174

DavidLazarescu opened this issue Aug 6, 2021 · 2 comments

Comments

@DavidLazarescu
Copy link

Is there any ways to copy content per e.g. ctrl+v or right-click into the input field?

@ArthurSonzogni
Copy link
Owner

FTXUI uses only one API: reading/writing to stdout/stdin by following the terminal specification.
Accessing the clipboard is usually a specific API specific to each OSs, which FTXUI do not use.

However, on most terminal, pressing ctrl+v should paste the content of the OS's clipboard to stdin, which implement "pasting" correctly. At least it works great on my terminal emulator.

Outside of this, support for clipboard is null in FTXUI.

In the terminal specification, I see there are some API defined about the clipboard:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#:~:text=clipboard%2C%20primary%2C%20secondary
maybe this could be used one day?

I am not sure a lot of terminal implement it however. I see microsoft just did it very recently:
microsoft/terminal#2946

About right click, FTXUI reports right click. You can try the example "print_key_press". This should display "right" from here:

@DavidLazarescu
Copy link
Author

FTXUI uses only one API: reading/writing to stdout/stdin by following the terminal specification.
Accessing the clipboard is usually a specific API specific to each OSs, which FTXUI do not use.

However, on most terminal, pressing ctrl+v should paste the content of the OS's clipboard to stdin, which implement "pasting" correctly. At least it works great on my terminal emulator.

Outside of this, support for clipboard is null in FTXUI.

In the terminal specification, I see there are some API defined about the clipboard:
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#:~:text=clipboard%2C%20primary%2C%20secondary
maybe this could be used one day?

I am not sure a lot of terminal implement it however. I see microsoft just did it very recently:
microsoft/terminal#2946

About right click, FTXUI reports right click. You can try the example "print_key_press". This should display "right" from here:

I will, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants