From dac6fd3434ada3e876420d9d0bc61c008af9568c Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 17 Oct 2018 18:15:41 +1100 Subject: [PATCH] cmake: Fix Windows issue running menuconfig in Command Prompt if winpty on Path Previous version assumed having winpty on the Path meant that it would be needed, but some tools (like Atlassian Sourcetree) permanently add winpty to the path. Symptom is arrow keys not working in menuconfig dialog. --- tools/cmake/kconfig.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/cmake/kconfig.cmake b/tools/cmake/kconfig.cmake index 4eb132d96..aad91c10d 100644 --- a/tools/cmake/kconfig.cmake +++ b/tools/cmake/kconfig.cmake @@ -18,7 +18,11 @@ endmacro() if(CMAKE_HOST_WIN32) # Prefer a prebuilt mconf-idf on Windows - find_program(WINPTY winpty) + if(DEFINED ENV{MSYSTEM}) + find_program(WINPTY winpty) + else() + unset(WINPTY CACHE) # in case previous CMake run was in a tty and this one is not + endif() find_program(MCONF mconf-idf) # Fall back to the old binary which was called 'mconf' not 'mconf-idf'