Writefile to /dev/tty stopped working in nvim 0.9

I’ve been using this snippet for a while…at least since neovim 0.5. I recently updated to HEAD from 0.8 and I’m seeing failures with the following line:

call writefile([escape], '/dev/tty', 'b')

I’m guessing this might be an intentional change as part of the backend separation, but I’d like to confirm that it’s not a bug before trying to find a workaround. Does anyone know why this might have changed in 0.9?

I can’t see anything in the breaking changes since Neovim 0.8.

Which is your default shell?

shell is bash 4.4 on ubuntu. I can do the following in the same shell without error:

echo "foo" > /dev/tty

…but then the writefile in that function gives:

E482: Can’t open file /dev/tty for writing: no such device or address

so I’m confused.

I just tried

:!echo foo > /dev/tty

in Neovim (0.8 and 0.9), and get

warning: An error occurred while redirecting file '/dev/tty'
open: No such device or address

Also,

:!tty

outputs

not a tty

I also found this issue that seems relevant to this.
Maybe the same change has been applied to writefile, too.