Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

1.6 KB
Raw Blame
<!doctype html>
<html><head><meta charset="utf-8"><title>Log Probe</title>
<style>
body { background: var(--openidea-bg); color: var(--openidea-fg); font-family: var(--openidea-font, sans-serif); padding: 12px; }
button { font: inherit; padding: 6px; } pre { white-space: pre-wrap; }
</style></head><body>
<h2>Streaming log tab</h2>
<p>Grant process:bash in Settings → Plugins, then open the stream. Toggle Verbose to restart it. Switch tabs, find, clear, wrap, and close the tab.</p>
<button id="open">Open log stream</button>
<button id="denied">Try undeclared program</button>
<pre id="status" aria-live="polite"></pre>
<script>
const script = `i=0
while true; do
  i=$((i+1))
  printf 'INFO probe line %s — Unicode 日志\n' "$i"
  if [ "$1" = "--verbose" ]; then printf 'DEBUG verbose output enabled\n'; fi
  if [ "$i" = 1 ]; then printf 'WARN a long line for wrapping: %0200d\n' 0; fi
  read -t 1 ignored || true
done`;
const send = (program) => openidea.postMessage(JSON.stringify({
  op: 'open-log-tab', key: 'probe', title: 'Probe logs', program,
  args: ['--noprofile', '--norc', '-c', script, 'log-probe'],
  toggles: [{ id: 'verbose', label: 'Verbose', args: ['--verbose'] }]
}));
document.querySelector('#open').onclick = () => send('bash');
document.querySelector('#denied').onclick = () => send('sh');
openidea.onMessage(text => {
  if (text === 'open' || text === 'denied') { send(text === 'open' ? 'bash' : 'sh'); return; }
  let m; try { m = JSON.parse(text); } catch { return; }
  if (m.op === 'log-error') document.querySelector('#status').textContent = m.error;
});
</script></body></html>