This fixes an issue whereby the terminal doesn't get given a size by dobi and therefore it can be problematic to type long commands in an interactive terminal.
Reproduction Example:
Create a Dockerfile with the following contents:
FROM debian:latest
You should end up with the following result before this fix:
dobi debian-job
[WARN] meta.project is not set. Using default "Downloads".
[image:build debian] debian is fresh
[job: debian-job] Start
root@e5fc2dff86db:/# stty size
0 0
root@e5fc2dff86db:/#
Hold down a key to repeat typing for a while and you will see that the line wraps back to the beginning of the same line (doesn't perform a carriage return properly) and you will end up with the terminal overwriting the current line with the newly typed data. You can see in the example output below that the root@0e part of the terminal prompt has been overwritten with 'a':
dobi debian-job
[WARN] meta.project is not set. Using default "Downloads".
[image:build debian] debian is fresh
[job: debian-job] Start
root@0e83d5bbc229:/#
aaaaaae83d5bbc229:/# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
After the fix is applied (obviously the stty size result will depend upon the actual terminal size):
github.com/dnephin/dobi/dist/bin/dobi debian-job
[WARN] meta.project is not set. Using default "Downloads".
[image:build debian] debian is fresh
[job: debian-job] Start
root@854a6c77cf0d:/# stty size
65 273
root@854a6c77cf0d:/#
This fixes an issue whereby the terminal doesn't get given a size by dobi and therefore it can be problematic to type long commands in an interactive terminal.
Reproduction Example:
FROM debian:latest
dobi debian-job
stty size
You should end up with the following result before this fix:
After the fix is applied (obviously the stty size result will depend upon the actual terminal size):