* fix: Remove double-kill bug while keeping PowerShell (#777)
Problems fixed:
- Removed double TASKKILL execution when SendInterrupt is enabled
- Simplified kill logic to single TASKKILL command
- Added console window hiding for TASKKILL and PowerShell
- Improved PowerShell with -NoProfile and -NonInteractive flags
Key difference from reverted PR #855:
- Kept PowerShell instead of cmd.exe to avoid sound issues (#707)
- Still fixes the double-kill bug that caused orphaned processes
- Added window hiding for cleaner UX on Windows
- Better PowerShell performance with optimized flags
The previous code would run TASKKILL twice when SendInterrupt was
enabled, causing processes to not be properly terminated and leading
to port conflicts and orphaned processes.
This fix addresses #777 without introducing #707 sound issues.
Testing on Linux shows clean process transitions with no port conflicts.
Fixes#777
Avoids #707
* fix: clarify Windows send_interrupt handling
Document that Windows ignores send_interrupt and use CREATE_NO_WINDOW for clearer process spawning.
* Add env file config and warn on dangerous roots
* Add default env file list
---------
Co-authored-by: xiantang <zhujingdi1998@gmail.com>
* implement .env parsing and expanding
* implement .env parsing and expanding
* reload env on reload/rebuild as well
* default to empty env file. remove cyclical dependency stuff
* default to empty env file. remove cyclical dependency stuff
* use godotenv to parse, dont override global vars
* implement multiple env file support
* update readme and example config
* update readme some more
* fix typo
* dce in util.go
* Avoid loading env files on cancelled runs
* Clean up env load linting
---------
Co-authored-by: sirkostya009 <kosta.tovstik@gmail.com>
* feat: add app_start_timeout to proxy configuration and improve error handling
* fix: resolve P0 and P1 issues in app_start_timeout proxy feature
- Use context timeout for first HTTP request to prevent hanging
- Fix WriteHeader called before setting Content-Length header
- Simplify retry loop condition (for err != nil instead of for { if err == nil })
- Add code comments for clarity (HTML vs non-HTML response handling)
- Clean up strconv.Itoa usage (remove unnecessary byte conversion)
- Add documentation to air_example.toml explaining app_start_timeout
- Add comprehensive unit tests for timeout scenarios (5 test cases)
P0 fixes (critical):
- First request now uses context timeout
- WriteHeader now called after all headers are set
P1 fixes (strongly recommended):
- Documented in air_example.toml with usage examples
- Added TestProxy_appStartTimeout with 5 test scenarios
Related to #656 (proxy reload timing issue)
* test: add comprehensive test coverage for app_start_timeout feature
---------
Co-authored-by: Juan Gonzalez <jrg2156@gmail.com>
Co-authored-by: Juan Gonzalez <juanrgon@github.com>
* feat: silent flag in .air.toml, suppressing all air prints
useful if the app being watched has structured outputs that are being
piped into subsequent program/s.
* update: add silent to air_example.toml
* fix: fix linter
* feat: add live proxy
* fix: fix live reload script injection for pages with partial updates
* fix: fix proxy for post method and include more tests
* fix: fix reload script
* Add fatal format message
---------
Co-authored-by: Neemias Almeida <ndalmeida@bol.com>
Co-authored-by: xiantang <zhujingdi1998@gmail.com>
* feat: pre_cmd before each build
* test: pre_cmd option & runPreCmd func
* refactor: cmd&pre_cmd run logic into runCommand
* test: runCommand func
* docs: update example toml
* refactor: use fs to ensure pre_cmd is working
* feat: run post_cmd after ^C
* test: post_cmd
* docs: update example toml
* style: use single quotes instead of escape char
* Fix a few linter warnings
* Prevent double delays and add some docs
I just noticed that reusing `delay` for the poll interval will cause an unintended double delay (first the delay is used as interval, and when a change happened delay is used to wait before building after the change).
Adding a dedicated `poll_interval` parameter allows people to prevent that and apply a more fine-grained configuration.
Also added the new params to the example toml file with some docs which I forgot to do in the initial PR.
* feat: support executing bin again when bin exit
* fix bug and add feature flag
* add rerun test
* disable rerun in default
* fix logic error
* delete unnecessary code
* add default option in toml
Co-authored-by: xiantang <zhujingdi1998@gmail.com>
Can be enabled with the [build].exclude_unchanged config option.
On startup, walks the watched filepaths and stores current file checksums
in memory. After a file write event, the file is checked to determine if
the contents have changed since the previously cached checksum.