Yes, that would be awesome. If anyone can figure out how I'd love to know. I know you can set a timeout in sbcl. Maybe using that one could poll X11 for events, check for a C-g event and if found throw an 'abort or something. If not schedule another timeout. Or execute the code in a new thread and poll for events as well as the completion of the thread. If C-g shows up first then kill the thread. Seems hairy and a bit resource intensive and possibly laggy.
-Shawn On Mon, Oct 29, 2012 at 1:11 AM, z_axis <z_a...@163.com> wrote: > At least i wish i can cancel the `ping` and return control to stumpwm. > > 在 Mon, 29 Oct 2012 15:25:42 +0800,Shawn Betts <sabe...@gmail.com> 写道: > > >> On Sun, Oct 28, 2012 at 10:30 PM, z_axis <z_a...@163.com> wrote: >>> >>> I am using stumpwm built with threaded clisp-2.49. There is a user >>> defined >>> #'sh function as below: >>> (defun sh (cmd) >>> (let ((str (ext:run-shell-command cmd :output :stream))) >>> (loop for line = (read-line str nil) >>> until (null line) >>> do (print line)))) >>> >>> When run (sh "ping 192.168.1.1"), The stumpwm will not do anything. I >>> know >>> `ping 192.168.1.1` will not terminate unless user break it. >>> >>> What is an elegant way to handle such a problem ? >> >> >> As far as I know ping never quits. It just pings endlessly. So you've >> written a function that reads ping's output line by line until it >> quits, which it will never do. What do you want to have happen? >> >> -Shawn > > > > -- > 使用 Opera 革命性的电子邮件客户程序: http://www.opera.com/mail/ > _______________________________________________ Stumpwm-devel mailing list Stumpwm-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/stumpwm-devel