TCC and clipboard issue

Dec 7, 2009
238
2
Left Coast, USA
TCC 11.00.47, running under Windows 7

I continue to have odd problems with the clipboard. I had thought they were fixed, but they're back.

echo some string>clip:
echo some other string>>clip:


...works. But if I run a Perl script:

scriptname.pl [arguments] > clip:

...the output -- even if it is EXPLICITLY sent to STDOUT in the script -- is displayed at the terminal, and nothing goes into the clipboard.

If I run cmd.exe and do this:

scriptname.pl [arguments] | clip.exe

... the output gets into the clipboard, as expected.

What am I doing wrong here? This never failed under 4NT...

Maybe I need to update TC/TCC again? I haven't done it for a while. Do I need to uninstall/re-install? Or just download the latest version, run it, and point it at the same directory where it's installed now? (With no TCC command line open at the time, of course.)
 

rconn

Administrator
Staff member
May 14, 2008
12,312
147
> I continue to have odd problems with the clipboard. I had thought they
> were fixed, but they're back.
>
> echo some string>clip:
> echo some other string>>clip:
>
> ...works. But if I run a Perl script:
>
> scriptname.pl [arguments] > clip:
>
> ...the output -- even if it is EXPLICITLY sent to STDOUT in the script
> -- is displayed at the terminal, and nothing goes into the clipboard.

Assuming you're running Perl within TCC (i.e., you've checked Perl support
on the TCC OPTION Startup/Scripting section, then the problem you're seeing
is a (known, old) Perl bug.


> If I run cmd.exe and do this:
>
> scriptname.pl [arguments] | clip.exe
>
> ... the output gets into the clipboard, as expected.

This would be the same as unchecking Perl in the TCC OPTION dialog, so Perl
scripts are executed by the perl.exe rather than internally via the (buggy)
Perl dll.

Rex Conn
JP Software
 
Dec 7, 2009
238
2
Left Coast, USA
Assuming you're running Perl within TCC (i.e., you've checked Perl support
on the TCC OPTION Startup/Scripting section, then the problem you're seeing
is a (known, old) Perl bug.

Then the workaround is to un-check that box? (I just looked at it -- at the moment it's checked.)

Is it required to have that box checked to run Perl scripts when TCC is being used? If so: what is the specific purpose or effect of explicitly selecting Perl support in the TCC option dialog?

Putting it another way: what is the expected result of running Perl scripts with the box UN-checked? I'm going to try that immediately, but it'd be good to know what adverse effects (if any) I should expect.

If it's a known Perl bug: it never appeared, that I can recall, when I launched Perl scripts in a 4NT window. I must have done so thousands of times over the many years that I used 4NT.

And, this variation on the theme works within a TCC window:

cmd /c scriptname.pl [args] > clip:

Now the clipboard contains the output of the script. But remove "cmd /c" from the command, and it doesn't work again...
 
Dec 7, 2009
238
2
Left Coast, USA
A few minutes later . . . the clipboard problem stopped once I'd un-checked the Perl option in the OPTION dialog. Thanks for the advice about it. I didn't even remember that I'd checked the box...

So back to my previous question: what is the expected/desired functionality that is available, when the box is checked? Is it limited to being able to use TCC's @perl[] function? The script I ran after unchecking that selection -- didn't seem to have been impaired in any way.

Actually, with the box UNchecked I was still able to execute:

echo %@perl[print "hello"]

I'd have thought that un-selecting that option would render the %@perl[] function unusable. So clearly I don't yet understand the purpose of that little check-mark...
 

rconn

Administrator
Staff member
May 14, 2008
12,312
147
> Is it required to have that box checked to run Perl scripts when TCC is
> being used? If so: what is the specific purpose or effect of explicitly
> selecting Perl support in the TCC option dialog?

It is not required. Checking the box means that Perl scripts will be
executed within the TCC process, so you can set environment variables in
Perl that are then readable by TCC. Execution will also be slightly faster,
though probably not noticeable.

The problem is that Embedded Perl for Windows was not well designed or
implemented, and there are a number of bugs (such as this redirection
problem and ^C exception handling) that have been known & not fixed for
years. (The embedded Python, Ruby, Rexx, and Tcl support in TCC do not have
these problems.)

Rex Conn
JP Software
 
Dec 7, 2009
238
2
Left Coast, USA
The problem is that Embedded Perl for Windows was not well designed or implemented, and there are a number of bugs (such as this redirection problem and ^C exception handling) that have been known & not fixed for years. (The embedded Python, Ruby, Rexx, and Tcl support in TCC do not have these problems.)
Rex Conn
JP Software
This is an issue with ActiveState's Perl implementation? (That's the only one I use, v.5.10 at the moment, FWIW.)

If not ActiveState's: I recall having seen a non-ActiveState perl.exe in older o.s. versions I used. But at least on my home machine, under Win XP SP2, I don't find perl.exe either in %windir or %programfiles.
 
Similar threads
Thread starter Title Forum Replies Date
R How to? TCC 16.03: copy a file to the clipboard? Support 10
M Copying files (NOT file contents) to clipboard from TCC Support 17
A Clipboard managers and TCC Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
L FTYPE in TCC, less quirky than in cmd.exe Support 3
V Set path permanently from within TCC? Support 3
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
Joe Caverly tcc.exception.log Support 3
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
vefatica SCRIPT ... TCC disappears Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
fpefpe How to? tcc inifile (%_ininame) Support 3
M How to? Black TCC Prompt Support 2
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Jay Sage Extra TCC Tasks Support 6
vefatica Can I turn off the minimize to tray mechanism in TCC? Support 5
N Command execution slows down in TCC Prompt after a while Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
samintz How to? Is this doable in TCC? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.02.41 Uploaded Support 0
D TCC tab detaching & restarting Support 3
Ó Recent git output not shown on TCC Support 1
P Kill all other instances of tcc from a btm batch file Support 2
L Using TCC.exe through an SSH connection Support 3
M TCC color issue in ConEmu Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
Alpengreis Python support for 3.8.3 in TCC v26.x? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.01.40 uploaded Support 0
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 26.0.37 Uploaded Support 0
vefatica TCC waits for Office apps Support 4
Joe Caverly .BAT works in TCC-RT 25, but not in TCC-RT 26 Support 4
M Strange error messages from TCC in FTP copy Support 7
Kachupp Documentation tcc-rt versions Support 1
V Comments from a first-time user (TCC 26) Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 26.0.28 Support 0
C TCC 26 BATCOMP BTM problems? Support 5
E TCC/CMD difference Support 5

Similar threads