Author Topic: copy file name to clipboard does not work outside of slickedit  (Read 839 times)

losvatoslocos

  • New Community Member
  • Posts: 2
  • Hero Points: 0
hi all,

just noticed a strange thing with my Slickedit PRO v29.0.0.0 on Linux (still on trial).

If I do Copy Full Name To Clipboard or Copy Name To Clipboard, none of them can escape outside of the editor, in other words, I cannot paste the copied data in another app. Interestingly, if I select a text and copy it (CTRL+C), it does work and propagates to other apps. Is there anything I'm doing wrong? I thought such a trivial features should just work.

PS

If I do Edit -> List Clipboard, I always do see my filename or path added on top of the list. Weird.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7041
  • Hero Points: 535
Re: copy file name to clipboard does not work outside of slickedit
« Reply #1 on: February 10, 2025, 02:41:50 PM »
What specific Linux are you on? Works for me. Tried Linux Mint 21, Ubuntu 24, and Rocky 8.1

losvatoslocos

  • New Community Member
  • Posts: 2
  • Hero Points: 0
Re: copy file name to clipboard does not work outside of slickedit
« Reply #2 on: February 11, 2025, 08:58:07 AM »
Arch linux with Xorg 21.1.15-1 and Xfce 4.20.0.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7041
  • Hero Points: 535
Re: copy file name to clipboard does not work outside of slickedit
« Reply #3 on: February 11, 2025, 01:07:01 PM »
just tried to create an Arch Linux VM. This is a pretty raw linux. Without help, no way this happens.

It's very odd that you can manually select text and copy text with Ctrl+C and Ctrl+V works in other applications but copy_buf_name doesn't work. The copy_buf_name command() is a macro which does the same thing. 

Let's try something else. Open an existing file. Then go to the SlickEdit command line and run "copy-buf-name". This should copy the current file (buffer) name to the clipboard. This is a bit of a hail marry to see if something is going wrong elsewhere.

Code: [Select]
void _copy_text_to_clipboard(_str text,bool doAppend=false) {
   orig_view_id := _create_temp_view(auto temp_view_id);

   orig_markid := _duplicate_selection('');
   mark_id := _alloc_selection();
   _insert_text(text);
   top();_select_char(mark_id);
   bottom();
   _select_char(mark_id);
   _show_selection(mark_id);
   if (doAppend) {
      append_to_clipboard();
   } else {
      copy_to_clipboard();
   }
   activate_window(orig_view_id);
   _show_selection(orig_markid);
   _free_selection(mark_id);
   _delete_temp_view(temp_view_id);
}
« Last Edit: February 12, 2025, 02:10:50 AM by Clark »