Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to set kill_delay on windows #526

Open
joeyak opened this issue Feb 10, 2024 · 1 comment · May be fixed by #552
Open

No way to set kill_delay on windows #526

joeyak opened this issue Feb 10, 2024 · 1 comment · May be fixed by #552

Comments

@joeyak
Copy link

joeyak commented Feb 10, 2024

After looking into the source, I noticed that the kill_delay option is not used in windows. I understand there being no interrupt on windows, but I'm running into the issue where my build is so fast that there's no time for the process to fully shut down. I end up getting the output below.

image

My workaround for the ctrl+c delay is to create a sleep.exe executable that emulates the unix sleep command and use it in my post_cmd.

Here is my config

root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"

[build]
  args_bin = []
  bin = "tmp/main.exe"
  cmd = "go build -o ./tmp/main.exe ./cmd/twitchlogger"
  delay = 1000
  exclude_dir = ["assets", "tmp", "vendor", "testdata"]
  exclude_file = []
  exclude_regex = ["_test.go", "_templ.go"]
  exclude_unchanged = false
  follow_symlink = false
  full_bin = ""
  include_dir = []
  include_ext = ["go", "tpl", "tmpl", "templ", "html", "sql", "css", "js"]
  include_file = []
  kill_delay = "5s"
  log = "build-errors.log"
  poll = false
  poll_interval = 0
  post_cmd = ["sleep.exe 1s"]
  pre_cmd = ["templ.exe generate"]
  rerun = false
  rerun_delay = 500
  send_interrupt = true
  stop_on_error = true

[color]
  app = ""
  build = "yellow"
  main = "magenta"
  runner = "green"
  watcher = "cyan"

[log]
  main_only = false
  time = false

[misc]
  clean_on_exit = false

[screen]
  clear_on_rebuild = false
  keep_scroll = true
@zoofur
Copy link

zoofur commented Feb 19, 2024

I encountered the same problem.Sleep is not work for me.And i try this way to solve this problem.
post_cmd = ["taskkill /F /IM main.exe"]

@8LWXpg 8LWXpg linked a pull request Mar 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants