claude-prism/apps/desktop/src-tauri/src/main.rs
delibae 63483a2d2c feat: subprocess tectonic, editor shortcuts, and UX improvements
- Isolate tectonic compilation in subprocess to prevent font cache
  assertion crash on retry (fixes #67)
- Fix unreachable pattern warning in lib.rs by merging duplicate
  WindowEvent::Focused match arms
- Add editor shortcuts: Cmd+B (bold), Cmd+I (italic), Cmd+/ (comment)
- Add Tab/Shift-Tab indent support in CodeMirror editor
- Fix WebKit rendering artifacts with translateZ(0) on .cm-scroller
- Force recompile on button click and Cmd+Enter (skip generation check)
- Add minimum 500ms compile spinner for visual feedback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 02:38:56 +09:00

22 lines
929 B
Rust

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
// Hidden CLI mode: when invoked with `--tectonic-compile <work_dir> <main_file>`,
// run tectonic in this subprocess and exit. This isolates tectonic's global C state
// so that a failed compilation doesn't poison the font cache for subsequent runs.
let args: Vec<String> = std::env::args().collect();
if args.len() >= 4 && args[1] == "--tectonic-compile" {
let work_dir = std::path::Path::new(&args[2]);
let main_file = &args[3];
match claude_prism_desktop_lib::tectonic_compile_subprocess(work_dir, main_file) {
Ok(()) => std::process::exit(0),
Err(e) => {
eprintln!("{}", e);
std::process::exit(1);
}
}
}
claude_prism_desktop_lib::run()
}