TSE: Copy: Clipboard: CopyToWinClip: In Microsoft Windows + Linux WSL + Linux non-WSL

8 views
Skip to first unread message

knud van eeden

unread,
Oct 10, 2025, 3:28:37 PMOct 10
to SemWare TSE Pro Text Editor
Hello,

TSE version 4.50.13.

The attached program copies to the system clipboard 
in and Microsoft Windows and Linux WSL and Linux non-WSL.

Compile it and then highlight a block then execute the macro via the menu
or run it using whenever you want to copy to the system
clipboard.

ExecMacro( "tocowblo" )

assign it possibly to a key, e.g. 

 <CTRL C> ExecMacro( "tocowblo" )

In Linux non-WSL you might have to install xclip once

sudo apt xclip

The interesting and aimed for property is thus that it copies to the
system clipboard successfully in the 3 different types of operating systems
using one and the same TSE macro.

E.g. CopyToWinClip() does not work at this moment in Linux WSL
and Linux non-WSL. This TSE macro does that copy thus, so use that
instead whenever you have to do that action.

with friendly greetings
Knud van Eeden

 
tocowblo.s

knud van eeden

unread,
Oct 10, 2025, 3:31:06 PMOct 10
to SemWare TSE Pro Text Editor
Hello,

TSE version 4.50.13.

The attached program paste from the system clipboard 
in and Microsoft Windows and Linux WSL and Linux non-WSL.

Compile it and then put the cursor where you want to paste
then execute the macro via the menu
or run it using whenever you want to copy to the system
clipboard.

ExecMacro( "frompalw" )

assign it possibly to a key, e.g. 

 <CTRL V> ExecMacro( "frompalw" )

In Linux non-WSL you might have to install xclip once

sudo apt xclip

The interesting and aimed for property is thus that it pastes from the
system clipboard successfully in the 3 different types of operating systems
using one and the same TSE macro.

E.g. PasteFromWinClip() does not work at this moment in Linux WSL
and Linux non-WSL. This TSE macro does that paste thus, so use that
frompalw.s

Guy Rouillier

unread,
Oct 11, 2025, 12:33:52 AMOct 11
to sem...@googlegroups.com
I'm running 4.50.13 on Ubuntu MATE 24.04.3 LTS (booted, not WSL). Without loading your macro, copying from a Firefox browser window using ctrl-ins and pasting into a TSE running in a MATE Terminal with shift-ins works.  So what does your macro do that is not already in place?

The only issue I see is that when I paste, only part of the text is pasted.  I have to tap the right cursor key for the rest of it to be pasted.
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/276263167.1733370.1760124647424%40mail.yahoo.com.

-- 
Guy Rouillier

Guy Rouillier

unread,
Oct 11, 2025, 12:44:12 AMOct 11
to sem...@googlegroups.com
A little more on the paste issue. I got curious, so I tried pasting the same
buffer into vi (a terminal program) and xed (an X/GUI program). Both of them
pasted the entire string.

So, partial pasting of the copy buffer in TSE is unique to it, i.e., a bug.
--
Guy Rouillier

knud van eeden

unread,
Oct 11, 2025, 4:59:17 AMOct 11
to sem...@googlegroups.com
If BOTH <Ctrl Ins> and <Shift Ins> for copy to and paste from the system clipboard
work in your MATE terminal then that is a big exception.

In the 'xterm' terminal only one of the two keys work and likely only one can work ever.

in xterm very many (more) keys in TSE for Linux work.

Otherwise to convince yourself try yourself all the keys defined in your .ui file in your MATE terminal using the TSE ShowKey macro and  you will find out that the MAJORITY of those .ui defined keys do NOT work in your TSE MATE terminal).

So I would say at this moment that using my TSE macros it should work on all Linux non-WSL distributions and its terminals where you can install e. g. xclip.

In addition using the same TSE macro it works also on Linux WSL and if you want even on Microsoft Windows.

E.g. define these 2 keys in your .ui and burn

sc32 -b your.ui

on all 3 operating systems.

<Ctrl C> ExecMacro( "tocowblo" )
to copy 

<Ctrl V> ExecMacro( "frompalw" )
to paste

in order to copy to and paste.

Of course if one knows better general solutions let us know or if Semware implements native solutions in TSE for Linux would be the best solution, but at the moment the typical system copy and system paste (e.g. using CopyToWinClip() and PasteFromWinClip() as commands are present in all the TSE menus but do definitely NOT work on Linux WSL and Linux non-WSL or your TSE programs out of the box).



Kind of 'write once, use everywhere' idea.

Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

knud van eeden

unread,
Oct 11, 2025, 8:11:01 AMOct 11
to sem...@googlegroups.com

According to the tse.ui for TSE for Linux this should happen if you press
those keys:

<Ctrl Ins>              CopyToWinClip()

<Shift Ins>             PasteFromWinClip()

and that is what is default burned in to the TSE e editor
and what is expected to happen if you press
any of those 2 keys when running it in Linux (WSL or non-WSL).

===

Note: You are thus *fully right* regarding 
your description of using

 <Shift Ins> 

(and having to click the right cursor button
afterwards to get the full paste information,
which is or looks indeed something like a bug).

That works in TSE for Linux 4.50.13 on non-WSL Linux Ubuntu
between applications.

So using <Shift Ins> is definitely also a method to paste from the system
clipboard in Linux non-WSL into TSE.

That <Shift Ins> action thus definitely pastes from the system clipboard.

But that it works MUST be something on (Linux) Operating System level.

Because pressing <Shift Ins> in TSE showkey macro
does NOT show 
 <Shift Ins> 

as expected, but 

 </> 

instead, so TSE will not react to that.

See the first screenshot below showing that </> after pressing
<Shift Ins> when running the TSE native macro 'showkey'.

I assume thus this working paste is operating system level behavior and NOT 
caused by TSE executing PasteFromWinClip(), because that PasteFromWinClip() is 
NOT implemented at all by Semware at this moment in TSE for Linux non-WSL.

===

Regarding its counterpart 

 <Ctrl Ins> 

(=copy to system clipboard) that could thus
actually work in Linux non-WSL.

See the second screenshot below.

Root cause: But Semware has NOT implemented CopyToWinClip() for Linux non-WSL, so that
<Ctrl Ins> key press action does nothing and is thus ignored.

===

Screenshot: 

Result of pressing <Shift Ins> (thus paste from system clipboard) in TSE for Linux 4.50.13 running on Linux non-WSL Ubuntu
inside an xterm terminal. It shows thus </> instead of the expected <Shift Ins>

Inline image

Screenshot: 

Result of pressing <Ctrl Ins> (thus copy to system clipboard) in TSE for Linux 4.50.13 running on Linux non-WSL Ubuntu
inside an xterm terminal. It shows thus as expected <Ctr Ins>.




Inline image


knud van eeden

unread,
Oct 11, 2025, 8:21:19 AMOct 11
to sem...@googlegroups.com
CopyToWinClip()
and 
PasteFromWinClip()

do thus not work in TSE for Linux 4.50.13 or lower.

See screenshot

Inline image


Reply all
Reply to author
Forward
0 new messages