-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 L Walsh wrote: > Micah Cowan wrote: >> An interesting idea that Tony Lewis came up with was the ability to send >> Wget an interrupt (Ctrl-C), bringing up an interactive mode that allows >> one to modify configuration on-the-fly. He told me about it in response >> to an issue report I filed suggesting that Wget allow users the option >> to skip the current file on interrupt, rather than quit completely; or >> to exit gracefully (for instance, by completing any outstanding -k >> conversions). That core functionality is expected to go in at some point >> for 1.12, but probably not the config-altering; that might be easier to >> put in for the "snazzier" re-envisioning of Wget, though. > --- > That was one of my 'less elegant' methods BUT -- I didn't > think of the "special "re-input" mode part. I would carefully > consider using control-C -- that has other defined semantics.
No, it really doesn't. Control-C is the canonical interrupt-signal-sending key. Interrupt doesn't always mean "quit", it just means "interrupt". In our case, it could be ambiguous whether an interrupt is meant to just terminate downloading of a large file that the user hadn't meant to be included, or terminate altogether; and whether or not post-processing should be done if termination _was_ desired is another ambiguity. However, extending it to modify configuration might be a bit unusual, and a "wget-control" program to modify currently-running Wgets might be preferable. And I don't mean that we would actually try to check for Control-C; I mean that we would trap SIGINT. If the user's terminal was configured to use some other key than Control-C, then it'd be that key that triggers this mode, and not Control-C. However, it'd probably be worth allowing users to explicitly configure what should be done on Control-C, rather than presenting a menu (which would still be one of the possible settings for what should be done on interrupt). > But, aren't the SIGUSR[12] sorta intended for situations like that? > Sorta like the idea. Those are intended for whatever you want to use them for. Most typically they cause graceful exits or config re-reading. The graceful exit is useful (obviously, since I mentioned it as a possible handling for Control-C), but issuing a SIGUSR1 is usually done from init-scripts to communicate with daemons; it's not really convenient for terminal apps, as it requires finding the relevant wget process's pid, and invoking the "kill" command from a separate terminal (or at least suspending Wget first, I guess). - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHK5bj7M8hyUobTrERCKzeAJ40RNqZ9Huzqi0hTAAzrbrNaGVJLwCdFzRL p91AT/GWr3e6k0LC3Kbbrs8= =Nauc -----END PGP SIGNATURE-----