- Guest
Add a Ctrl+C button: Allow aborting an "interactive command"
Advertisement
Many, many times I accidentally run an "interactive command" in WinSCP's Terminal, only noticing it's an "interactive command" after everything freezes up. I'd like a "Send Ctrl+C" button (or just let pressing Ctrl+C work). I want it to send Ctrl+C to the server, not do whatever the "Abort" button does.
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,453
- Location:
- Prague, Czechia
Ctrl-C does not have the functionality you want, unless TTY is on for the session. And WinSCP has to have it off.
- Guest
I'm talking about SFTP, it already "starts another session" for the Terminal. So that 2nd session should already be isolated. Can you send Ctrl+C in that case? Somehow you are able to send text to the server...each command one after the other. I do understand the Terminal/Console inside WinSCP is limited, but I don't understand exactly how limited.
Without aborting that session, I can "get out" of this frozen situation, but opening another WinSCP & Terminal/Console, then doing "ps U user", then "kill <pid>" of the interactive process. So perhaps, if you can't "send keys" or "send Ctrl+C" to that 2nd session, you could allow opening another session on top of it, so I can issue kill.
I'm just trying to think if there's any way to over come this. Are there any Docs/Info on how you are currently doing it/what the limitations are?
Without aborting that session, I can "get out" of this frozen situation, but opening another WinSCP & Terminal/Console, then doing "ps U user", then "kill <pid>" of the interactive process. So perhaps, if you can't "send keys" or "send Ctrl+C" to that 2nd session, you could allow opening another session on top of it, so I can issue kill.
I'm just trying to think if there's any way to over come this. Are there any Docs/Info on how you are currently doing it/what the limitations are?
-
martin◆
Site Admin - Joined:
- Posts:
- 41,453
- Location:
- Prague, Czechia
Try to connect with PuTTY with Don't allocate a pseudo-terminal enabled. You will see what is possible and what not.I do understand the Terminal/Console inside WinSCP is limited, but I don't understand exactly how limited.
Isn't it easier to abort the session?Without aborting that session, I can "get out" of this frozen situation, but opening another WinSCP & Terminal/Console, then doing "ps U user", then "kill <pid>" of the interactive process. So perhaps, if you can't "send keys" or "send Ctrl+C" to that 2nd session, you could allow opening another session on top of it, so I can issue kill.
- Guest
...I believe when I do that, I can't even type commands, at all. So something is different between that & whatever WinSCP does/can do. WinSCP can send commands (aka type commands), it just can't fully connect the TTY input/output. Since it can send text-based commands (somehow!), I figured it could send "the Ctrl+C character". Somehow, WinSCP knows to "wait for the command prompt to return" (cuz if it don't return in 15 secs you get that Abort msg)...so perhaps just make it "not wait" & lemme send another command, like kill or Ctrl+C.Try to connect with PuTTY with Don't allocate a pseudo-terminal enabled. You will see what is possible and what not.
I think I plan on reading the source, if for no other reason, than to try to understand why it can't do these things. The answer might be in the source download, but if not, I'll go ahead & ask: What do you use to compile WinSCP? Can it compile with MinGW? LOL, I just searched: How to compile winscp?...so you can't compile with MinGW...& I will "See readme file in source code archive."...but why didn't you just mention, in that topic, what you can compile with instead of just saying "No, you can't compile with this or that or that". But in any case: Why can't you compile with MinGW? That seems to be the best/easiest Freeware Windows Compiler. Do you mean it "doesn't work with MinGW out-of-the-box" or "it can't ever work/compile with MinGW"? Oh no: more searching has posts talking about "Borland C++ 6.0 Enterprise"...do I really need a payware compiler to compile a freeware program??? why oh why??? Just to show I've really been searching, I found this in history_old for version 3.7: "WinSCP can be now compiled using Personal edition of Borland C++Builder 6.". I guess "Personal Edition" means there's a "free" version of that payware compiler, but: Would it not be worth it to ween WinSCP off the Borland compiler & onto MinGW or GCC? Yes, I know changing the compiler would be a lot of work...but I think it would be good (in the long-run) to head in that direction. WinSCP is open source freeware & should not depend on a half-payware compiler. Can you make a topic (or Doc page) about what all in the source is dependent on BC++ builder? Is there any specific Doc page about "Compiling"...or is that info just in the readme of the source download? Something I found while searching mentioned a "drag & drop library" where the author wouldn't allow you to post source without his permission, but his website doesn't exist anymore, so you can't get his permission...is that still the case or any updates on that issue? Can't you just call it "his loss"? -- he didn't maintain his website, you can't contact him, so just release it & see if he contacts you to complain. How did you get his source anyway? He had to know people would use it...maybe, at the time, he just wanted to know if people were using it? It was probably a long time ago, before open source was so common. That or find an actually open source library to replace it with. Can you post where the website was or any more info you know about it (name of the library) or him (his name). Perhaps post any copyright msgs at the top of his source? We need to either find him or at least do something. WinSCP needs to be open source, that people can actually compile.
...no & yes...no, I don't like to fully Abort the session, cuz then I have to login again, but yes, since I already have to login twice to open a new WinSCP & Console, then it would be easier to Abort & login once. I just wanna make absolutely sure there is not some way to regain control, other than fully Aborting. Also, when I Abort, sometimes WinSCP will get really irritated & do "Invalid Access to Memory" or even crash/close. Which means I lose any new commands I typed in the Console recent commands list (it appears to only save/update that list on a clean close), so sometimes doing those steps to recover, in the long way I do it, is the best solution, if I wanna save my new recent Console commands, that were typed in the now-stalling window.Isn't it easier to abort the session?
About the logging twice thing: Can I ask for a pref (or point me to it if I missed it) to ALWAYS open the "Console session" when opening the "Main session"...I wanna open BOTH (at the beginning of the session) by typing the password once.
Note: I hope you don't take offense to anything in this msg, I get started on an issue & then I run with it, sometimes I might not word stuff in the nicest way (tho I try). Are my posts helpful at all or just me rambling? Have you ever seen such long posts?
Advertisement
-
martin◆
Site Admin - Joined:
- Posts:
- 41,453
- Location:
- Prague, Czechia
Maybe your shell or something cannot deal with absence of TTY. Or you actually can type commands, just that you do not see it? Have you tried entering a command blindly and pressing enter?...I believe when I do that, I can't even type commands, at all.
Neither is possible.Since it can send text-based commands (somehow!), I figured it could send "the Ctrl+C character". Somehow, WinSCP knows to "wait for the command prompt to return" (cuz if it don't return in 15 secs you get that Abort msg)...so perhaps just make it "not wait" & lemme send another command, like kill or Ctrl+C.
There's readme file in the source code package.but why didn't you just mention, in that topic, what you can compile with instead of just saying "No, you can't compile with this or that or that".
Almost everything. Sorry, this is something what is not worth discussing at all.Can you make a topic (or Doc page) about what all in the source is dependent on BC++ builder?
I'm not aware of any.I just wanna make absolutely sure there is not some way to regain control, other than fully Aborting.
Can you reproduce this easily? Is it worth trying to debug it?Also, when I Abort, sometimes WinSCP will get really irritated & do "Invalid Access to Memory" or even crash/close.
This request is tracked already:About the logging twice thing: Can I ask for a pref (or point me to it if I missed it) to ALWAYS open the "Console session" when opening the "Main session"...I wanna open BOTH (at the beginning of the session) by typing the password once.
https://winscp.net/tracker/80
- Guest
...I was a little confused. After I posted, I tested, the behavior I described, not being able to type commands at all, happens when you check "Don't start a shell or command at all" which I confused with your recommendation of "Don't allocate a pseudo-terminal"...you are right, when I use that 2nd option, I can type commands, just not interactive commands & Ctrl+C seems to not work. Neither does any of the "Special Commands" in the PuTTY system menu, like SIGINT, SIGTERM, SIGKILL...not sure what those "Special Commands" are for, but they seem useless, with TTY or not....I believe when I do that, I can't even type commands, at all.
...OK, how about this: I've been planning on writing a PHP/CGI script to do the "ps U <username>" or even "pstree <username>"...so I can list the processes for my username & click on them to kill them...would this be possible in WinSCP? A "kill window"...open a window that would list processes under your username (by running some command) & allow you to kill them? WinSCP could open "another session" to handle this. Is there a reason you only have "main session" & "secondary session"? What about unlimited (or many) "secondary" sessions?...or just "main", "secondary", "emergency"...the "emergency session" would be used to issue kill commands for un-freezing the 2nd session.Neither is possible.
...yes, but I need to try with newer versions 1st. I've only used WinSCP 3.8.2 (1st version I downloaded) & WinSCP 4.1.9...both are now old, but I will test & reproduce with those, then test again with something newer & report. Basically, just open the main session, open the 2nd session, type an interactive command, so it freezes, then Abort it & reconnect, repeat this until it crashes. Should only take 1 or 2 Aborts/Reconnects to crash 3.8.2 or 4.1.9.Can you reproduce this easily?
...yes, of course. But hopefully in all those interim versions it could've been fixed.Is it worth trying to debug it?
...um, OK, it was the 80th bug tracked...are you planning on doing it?This request is tracked already...
- Guest
Also, when I Abort, sometimes WinSCP will get really irritated & do "Invalid Access to Memory" or even crash/close.
Can you reproduce this easily?
...I have now tested with 4.2.8 (no not the "most recent stable" {4.2.9} or even the "current beta" {4.3.1}, but newer none-the-less)....yes, but I need to try with newer versions 1st.
Steps to reproduce...tested on WinSCP 4.2.8...
- Connect to a server
- Click toolbar button: "Open Terminal (Ctrl+T)"
- Type any interactive command (I used "nslookup"), press Enter
- Wait for "Abort" window, click Abort
- Click Reconnect (or wait for timeout)
- Get Error msg: "Can't end transaction, not in transaction", click OK.
- "Terminal" window closes, you are returned to file list/main window
- Click toolbar button: "Open Terminal (Ctrl+T)"
- Type any interactive command (I used "nslookup"), press Enter
- Wait for "Abort" window, click Abort
- Click Reconnect (or wait for timeout)
- This time, it seems to reconnect fine, however...
- Type any command (interactive or not...I used "nslookup"), press Enter
- Get Error msg: "Invalid access to memory", click OK.
- Repeat step 13, keep getting error in step 14, stop repeating when bored.
- Close Terminal window, since it seems useless/broken.
- Terminal window closes, returned to main window, however...
- Get Error msg: "Abnormal program termination", click OK.
- All of WinSCP closes.
Examples...
- List with no bullets or numbers
- List with bullets
- List with numbers
Also, on this forum only, I need to add a blank line before a list or it's "smooshed together"...
Smooshed...
- ...with list
- ...from list
Nested List...
- Level 1
- Level 2
- Level 3
- Level 2
Anyway, ignoring the "Nested List" issue (that I can't reproduce right now), look at the "Examples..." above...there is a large blank line between each example, now look at the post's source, they are smooshed as close as I can get them to remove space, however the space remains.
- Guest
Have you tried my "Steps to reproduce" above?
Advertisement
-
martin◆
Site Admin
Not yet, I have it on TODO list :)Have you tried my "Steps to reproduce" above?
-
martin◆
Site Admin - Joined:
- Posts:
- 41,453
- Location:
- Prague, Czechia
I to have fixed the above problem. Can you send me an email, so I can send you back a debug version of WinSCP to test? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.
You will find my address (if you log in) in my forum profile.
- Guest
...I never meant to ignore this post (I read it a while ago, but never replied), but as you can see, I haven't registered on this forum yet....so I can send you back a debug version of WinSCP to test?
I was wondering, is this fix in 4.3.2 or are you waiting for me to test the debug version?
Could you possibly just link to a beta/debug version here?
-
martin◆
Site Admin
Well, actually the fix might be included. Though it is not listed in the release notes as I didn't receive any confirmation from you. So can you try to reproduce it with 4.3.2?
Advertisement
You can post new topics in this forum