Author Topic: Slickedit doesn't paste from clipboard  (Read 443 times)

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Slickedit doesn't paste from clipboard
« on: September 05, 2023, 07:20:14 pm »
SlickEdit Pro 2023 (v28.0.0.2 64-bit Qt4) on Ubuntu 22.04.2 LTS.

I'm trying to paste into a Slickedit buffer after copying a large amount of text via tmux-yank.  I can open other apps and paste in, but Slickedit doesn't "accept" the buffer; it just does nothing.  Small copy/pastes work fine.

https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/ talks about what I've configured, specifically the bind commands, and "xsel -i".

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #1 on: September 05, 2023, 08:31:29 pm »
I can't seem to install this tool to test it. No idea what I'm doing wrong.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3910
  • Hero Points: 512
Re: Slickedit doesn't paste from clipboard
« Reply #2 on: September 05, 2023, 08:35:53 pm »
OP:  You could try the Qt5 edition and see if that works better for this case.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #3 on: September 05, 2023, 08:59:09 pm »
« Last Edit: September 05, 2023, 11:32:36 pm by Clark »

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Re: Slickedit doesn't paste from clipboard
« Reply #4 on: September 07, 2023, 05:00:03 pm »
OP:  You could try the Qt5 edition and see if that works better for this case.

Same problem - it just doesn't paste a large buffer into Slickedit.

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Re: Slickedit doesn't paste from clipboard
« Reply #5 on: September 07, 2023, 05:03:41 pm »
I can't seem to install this tool to test it. No idea what I'm doing wrong.

https://phoenixnap.com/kb/tmux-tutorial-install-commands talks about getting tmux up and running. 
https://github.com/tmux-plugins/tmux-yank talks about installing tmux-yank, which is a plugin for it that makes pasting outside tmux work "better" (allegedly).

I'm wondering if there's something weird with how Slickedit interprets the clipboard.  I also don't know how each linux clipboard works - per https://unix.stackexchange.com/questions/84246/how-many-clipboards-are-in-system there are primary, secondary and clipboard.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #6 on: September 07, 2023, 05:59:44 pm »
Quote
The easiest way to install tmux-yank is via the Tmux Plugin Manager.

1. Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'tmux-plugins/tmux-yank'

2. Use prefix–I install tmux-yank. You should now be able to tmux-yank immediately.

3. When you want to update tmux-yank use prefix–U.
I think I've got step 1 right. I have no idea what step 2 "Use prefix-I install tmux-yank..." means.

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Re: Slickedit doesn't paste from clipboard
« Reply #7 on: September 07, 2023, 07:01:34 pm »
Sorry for the piece-meal instructions - it's been a while since I installed this from scratch.

https://github.com/tmux-plugins/tpm talks about how to install plugins.

"prefix" means the default keystroke to tell tmux you're about to do something interesting tmux should catch.  It defaults to Ctrl+b

https://github.com/tmux/tmux/wiki/Getting-Started#the-prefix-key

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #8 on: September 07, 2023, 07:11:29 pm »
Here's what happening. Once I install tmux-yank, I don't seem to be able to create a clipboard using the mouse or keyboard. Can't even copy one word or one line.
Here's what's in my .tmux.conf:
Code: [Select]
set -g mouse on

# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode    DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode    TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

set -g mouse on

# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode    DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode    TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

Any time I select a small piece of text (like one word) in the terminal session, the selection immediately disappears. I would think this would mean that the text was copied to the clipboard. However, there's definitely nothing there. I can't paste in any app I've tried. It also, doesn't destroy the clipboard that was there prior to me selecting text with the mouse.

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Re: Slickedit doesn't paste from clipboard
« Reply #9 on: September 07, 2023, 07:22:30 pm »
Here's what happening. Once I install tmux-yank, I don't seem to be able to create a clipboard using the mouse or keyboard. Can't even copy one word or one line.
Here's what's in my .tmux.conf:
Code: [Select]
set -g mouse on

# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode    DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode    TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

set -g mouse on

# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode    DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode    TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

Any time I select a small piece of text (like one word) in the terminal session, the selection immediately disappears. I would think this would mean that the text was copied to the clipboard. However, there's definitely nothing there. I can't paste in any app I've tried. It also, doesn't destroy the clipboard that was there prior to me selecting text with the mouse.

That rings a bell.. here's the end of my .tmux.conf:
Code: [Select]
# Enable the mouse stuff...
set -g mouse on

# tmux-yank stuff - https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/
# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode    DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode    TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"

# Stop auto naming
set-option -g allow-rename off

# Longer history
set -g history-limit 50000


#
# Tmux Plugin Manager and Plugins
#
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-logging'

# More tmux-yank
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

run -b '~/.tmux/plugins/tpm/tpm'

I don't think the "Stop auto naming" or "Longer history" should affect the copy-paste issue.

If the other two plugins get in the way (resurrect and logging) you can probably comment those out.

I think the last 2 binds leave the selection selected.  The way I tend to work is to highlight what I want, then hit 'y' to yank it into a clipboard.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #10 on: September 07, 2023, 07:33:11 pm »
I replaced the contents of my .tmux.conf with your contents above and the selection still disappears. I exited and restarted tmux. Any ideas?

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Re: Slickedit doesn't paste from clipboard
« Reply #11 on: September 07, 2023, 07:50:34 pm »
I saw some weird behavior with an instance of tmux running the in background.. i did
Code: [Select]
ps ax | grep tmux and made sure none were running when I restarted, then my changes "took".

Also
Code: [Select]
tmux -Vgives me
Code: [Select]
tmux 3.2a

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #12 on: September 07, 2023, 08:04:53 pm »
I rebooted my computer to make sure things were completely restarted. No luck. Selection always disappears. I have the same version as you (3.2a)

Code: [Select]
# Enable the mouse stuff...
set -g mouse on

# tmux-yank stuff - https://www.seanh.cc/2020/12/27/copy-and-paste-in-tmux/
# These bindings are for X Windows only. If you're using a different
# window system you have to replace the `xsel` commands with something
# else. See https://github.com/tmux/tmux/wiki/Clipboard#available-tools
bind -T copy-mode    DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode    TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "xsel -i"
bind -n MouseDown2Pane run "tmux set-buffer -b primary_selection \"$(xsel -o)\"; tmux paste-buffer -b primary_selection; tmux delete-buffer -b primary_selection"

# Stop auto naming
set-option -g allow-rename off

# Longer history
set -g history-limit 50000


#
# Tmux Plugin Manager and Plugins
#
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-logging'

# More tmux-yank
set -g @yank_action 'copy-pipe-no-clear'
bind -T copy-mode    C-c send -X copy-pipe-no-clear "xsel -i --clipboard"
bind -T copy-mode-vi C-c send -X copy-pipe-no-clear "xsel -i --clipboard"

run -b '~/.tmux/plugins/tpm/tpm'

« Last Edit: September 07, 2023, 08:08:18 pm by Clark »

astromme

  • Senior Community Member
  • Posts: 124
  • Hero Points: 1
Re: Slickedit doesn't paste from clipboard
« Reply #13 on: September 08, 2023, 04:42:35 pm »
I'm kind of at a loss.  The only thing I can think of is the other tmux plugins aren't installed, so it bails before installing tmux-yank.

Try deleting the resurrect and logging set -g @plugin lines.

If that doesn't work, can I help with examining the clipboard after I yank with tmux on my computer?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6582
  • Hero Points: 511
Re: Slickedit doesn't paste from clipboard
« Reply #14 on: September 08, 2023, 05:16:25 pm »
Still no luck. Since we have to go through Qt's hocus pocus, there's no way you can help.