Terminal input treated different when programm is executed by gradle-task


(Sebastian Runbekannt) #1

Here is a simple python3 example programm test.py:

print('input value')
value = input()
print('your value',c value)

If this programm is executed by “python test.py” (in the linux terminal, e.g. bash or zsh), the keboard-input works fine.
When i execute this file by gradle, the input is treated different.
Example gradle task:

task (testInput, type:Exec){
  standardInput = System.in
  commandLine 'python', 'test.py'
}

Arrow-keys are displayed as “^[[A^[[C^[[D”
Even if gradle opens a bash, the input is treated “wrong”:

task (testInput, type:Exec){
   standardInput = System.in
   commandLine 'bash'
}

How can this switched off?