Skip to content

air not working when project directory is a symlink #531

@Tachi107

Description

@Tachi107

Hi, it seems that air is unable to watch files when accessing the project through a symlink. Here are the steps to reproduce the problem:

$ mkdir project
$ cd project
$ cat > main.go <<EOF
package main
func main() {
	for {}
}
EOF
$ go mod init project
$ air
  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ v1.49.0, built with Go go1.21.6

mkdir /tmp/tmp.nE9SAKeGRq/project/tmp
watching .
!exclude tmp
building...
running...
^Ccleaning...
see you again~
$ cd ..
$ ln -s project symlink
$ air
  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ v1.49.0, built with Go go1.21.6

mkdir /tmp/tmp.nE9SAKeGRq/symlink/tmp
building...
running...
^Ccleaning...
see you again~

As you can see, when cding into the symlink file, air doesn't print the watching . message, and indeed doesn't watch for file updates.

How can I solve this issue? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions