Hi,
I bumped into a problem while checking the R bundle.
There's a command which outputs HTML source to display the result within TM's HTML output window.
If I start TM and execute this command everything will be displayed correctly. Then I close the HTML window, I modify some code, and invoke the same command again to come up with an HTML output window I only see the spinning wheel and a blank window. After ~30s the HTML window displays the correct picture.
I was able to narrow down the problem and attached is a test environment (as a tmCommand). The problem is a non-existing CSS resource. If you invoke this command for the very first time, the HTML output window machinery simply ignores the non-existing CSS file and displays the content correctly. Fine. If you re-invoke the same command the HTML output keeps blank for half a minute. If you then delete the 4th "echo"-line containing R.css everything works perfectly.
Here the test code
#!/usr/bin/env bash [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">" echo "<html><head><title>R: Phonetic algorithms</title>" echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8">" echo "<link rel="stylesheet" type="text/css" href="R.css">" echo "</head><body>" echo "TEST" echo "</body><html>"
****************************************************** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher Platz 6 phone: +49 (0) 341 3550 341 D-04103 Leipzig fax: +49 (0) 341 3550 333 Germany e-mail: bibiko [at] eva.mpg.de ******************************************************
... sorry, I forgot some essentials:
I'm using: - Mac OS 10.10.1 - TextMate version 2.0-beta.6.7
Cheers, Hans :)
****************************************************** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher Platz 6 phone: +49 (0) 341 3550 341 D-04103 Leipzig fax: +49 (0) 341 3550 333 Germany e-mail: bibiko [at] eva.mpg.de ******************************************************
On 27 Jan 2015, at 1:29, Hans-Jörg Bibiko wrote:
If I start TM and execute this command everything will be displayed correctly. Then I close the HTML window, I modify some code, and invoke the same command again to come up with an HTML output window I only see the spinning wheel and a blank window. After ~30s the HTML window displays the correct picture […]
Thanks for the test case.
The issue was with relative URLs, these would be sent to my custom URL handler which wasn’t prepared to handle a “not found”, so no data was provided, causing WebKit to stall until its timeout had been reached.
It worked first time because a non-integer URL (sent to the custom URL scheme) was parsed as “job zero”, which would be the job ID of the first command with HTML output.
Next build has the issue fixed.