u/EconomyAd2752

I built a vim-style tiling browser in C

Started using vim a while back and the one part of my workflow that never felt right was the browser ,I do research-heavy stuff and switching tabs with a mouse like an animal was killing me. Took some inspiration from Hyprland and decided to write my own tiling browser shell from scratch.
Picked C because Rust is too smart for me and I have too much self-respect to write C++. Went with WebKit2GTK for the engine because Gecko's embedding API looks like it requires a PhD I don't have.
What it actually does:

- Tiles WebKit views into hjkl-navigable panes, vim-style modes (WM,View, Command)
- Each page lives in an offscreen GTK widget; every frame I pull the Cairo surface out, upload it as an SDL2 texture, and SDL composites it with the pane borders, command bar, link hints, etc.
- Damage tracking + 12 FPS idle cap so it doesn't cook the CPU when

I'm just reading

- Lua scripting in a real sandbox: instruction-budget hook, no`package` / `require` / `io` / `debug`, every URL Lua hands back goes through a single allowlist (`http`, `https`, `about`, `ftp`;`javascript:` rejected outright)

- Hardened by default: -D_FORTIFY_SOURCE=2, -fstack-protector-strong,

-fPIE, RELRO + BIND_NOW. CI builds clean and ASAN compiles clean.

- Per-profile isolation (separate cookies, cache, layout, Lua),0-second session autosave with atomic writes Alpha, Linux/X11 only. No Wayland yet, no browser extensions(WebKit2GTK doesn't have an extension layer that's the trade).
Posting here because I'd genuinely love eyes on the C. The render loop, the Lua sandbox, the URL pipeline, the hardening choices , all fair game. Roast it.

Repo: https://github.com/mrinalgaur2005/nativeShell

u/EconomyAd2752 — 26 days ago