The output without Carriage Return when I use ssh to execute a remote command. sometimes the output is too much. for example, the terminal print download progress updates each line when I execute ssh server -- "docker compose up -d --build". Is there any way to make the output the same as I execute it in the remote server terminal?
1 Answer
The docker application may be checking upon its invocation whether it is being run in a terminal, and altering its output based upon its findings.
The -t argument for ssh tells the client to open a remote terminal even if it doesn't think one is needed (which it often will presume when invoked to run a non-interactive environment, as is the case in your question).  You may find this invocation changes docker's output to your liking:
$ ssh -t server -- "docker compose up -d --build"

ssh -t?