-
Notifications
You must be signed in to change notification settings - Fork 54
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
remove need for xsel/xclip for lemonade client #18
Comments
I don't know the requirements from the code. |
Yes. I'll provide a sample error in a few days. |
@Shougo I am running into the same issue.
|
I get it. lemonade uses |
@Shougo doesn't that defeat the purpose? if I'm inside a headless docker containter I should be able to pipe a snippet of text through lemonade client and the server should be able to pick up the snippet and then use a tool to deliver the snippet to the host clipboard. makes sense? |
I don't understand lemonade architecture. |
I think the problem has two causes. First, lemonade uses old I've released lemonade with latest libraries. Second, lemonade can't find a lemonade server.
The above logs show it. Could you try to add |
@pocke I'm still seeing the issue with version 1.1.1. I'm now using SSH port forwarding so I am not seeing the fallback message, but I'm getting a bad exit status:
The server is receiving my commands but not acting on them. |
Hmm... I think the problem is like #19 . |
Regarding #19, I'm not getting |
Yes, that's really sadly. What FOR lemonade client need xclip or xcel for copypaste? It's transfer data over TCP anyway, not over -X. Why I need lemonade with -X, if with -X i can share clipboard as well? For mac/linux it's easy, just create connection with ssh -X user@host. That's it, now clipboard is shareble. Without any additional stuff. On Windows same, I can just run VcXsrv and then connect with Putty with enabled -X. So, lemonade should work like this way https://gist.github.com/dergachev/8259104 https://gist.github.com/burke/5960455. For now it's just doesn't make sence to use it, on any desktop, because same I can get with -X. |
@id777 You can create new PR for it. |
@id777 I don't think it needs it on the client - it need it in the server/host (in order to manipulate the clipboard). |
@Shougo @assaf758 |
OK. Thanks. |
This can be fixed with simple change. This change make server hold fallback string per the server instance. diff --git a/server/clipboard.go b/server/clipboard.go
index fa5ca05..0cdcfba 100644
--- a/server/clipboard.go
+++ b/server/clipboard.go
@@ -5,16 +5,27 @@ import (
"github.com/lemonade-command/lemonade/lemon"
)
-type Clipboard struct{}
+type Clipboard struct {
+ fallback string
+}
-func (_ *Clipboard) Copy(text string, _ *struct{}) error {
+func (c *Clipboard) Copy(text string, _ *struct{}) error {
<-connCh
+ s := lemon.ConvertLineEnding(text, LineEndingOpt)
+ if !clipboard.Unsupported {
+ c.fallback = text
+ return nil
+ }
// Logger instance needs to be passed here somehow?
- return clipboard.WriteAll(lemon.ConvertLineEnding(text, LineEndingOpt))
+ return clipboard.WriteAll(s)
}
-func (_ *Clipboard) Paste(_ struct{}, resp *string) error {
+func (c *Clipboard) Paste(_ struct{}, resp *string) error {
<-connCh
+ if !clipboard.Unsupported {
+ *resp = c.fallback
+ return nil
+ }
t, err := clipboard.ReadAll()
*resp = t
return err |
Still not. I'll look this patch in later. |
rationale:
when running a headless unix inside vagrant on a windows host, in other words, when you don't have xsel or xclip available because you don't have
X
server or client, I can't use lemonade.xclip or xsel should not be needed because you have a direct connection to lemonade server via TCP.
The text was updated successfully, but these errors were encountered: