fly ssh console -C <command> behavior vs fly ssh console

I’m running an Elixir Phoenix app. I noticed that the behavior is a bit different depening on which command I use to get to the app’s console.

fly ssh console and then app/bin/app remote works as expected. I can get access to app’s env.

> Application.get_env(:app, :storage)

fly ssh console -C "app/bin/app remote" doesn’t give me access to the app’s environment.

> Application.get_env(:app, :storage)

The other thing: when I use fly ssh console -C "app/bin/app remote" my cursor key presses show up as special symbols. When I use fly ssh console they actully move the cursor. (I use iterm2 on macOS)

Anyone had this behaviour?

When no command is provided, fly ssh console allocates a PTY (pseudo-terminal). It doesn’t do this if a command is provided (this is similar to how ssh behaves).

To force PTY allocation even if a command is provided you can pass --pty flag to fly ssh console.


thanks @pavel, --pty flag fixed both issues

ps. seems this option is not in the docs

Yeah, we had a problem with flyctl CI pipeline that syncs commands reference with the docs. AFAIK, it has been fixed and the next flyctl release should push the updated docs.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.