[ https://issues.apache.org/jira/browse/IOTDB-2634?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Pai reassigned IOTDB-2634: ------------------------------- Assignee: Eric Pai > Cli exit current cmd.exe instead of the start-cli.bat script file > ----------------------------------------------------------------- > > Key: IOTDB-2634 > URL: https://issues.apache.org/jira/browse/IOTDB-2634 > Project: Apache IoTDB > Issue Type: Bug > Components: Client/CLI > Environment: Windows OS > Reporter: Dongming Zhao > Assignee: Eric Pai > Priority: Minor > > The EXIT command was added to start-cli.bat in IOTDB-2523 to make sure the > script exit/return with the correct Exit Code. However, the EXIT *terminates > current cmd.exe* instead of just exiting the .bat script file. They are the > same while using CLI by double-click on the .bat file, as the activated > cmd.exe is temporal and will always be terminated by OS when the script > exits. But when we pre-activate a cmd.exe window and call the start-cli.bat > by file name/path, the EXIT will close the window and {*}prevent subsequent > user commands{*}. (By the way, Windows PowerShell is not affected.) Things > are similar when we call the start-cli.bat with CALL clause from another .bat > script and no commands after CALL will be executed. > One of the most affected thing is the register-UDF.bat for UDF-Library, which > is using multiple CALL start-cli.bat commands to register all UDF functions. > Now the script will exit once after the first CALL is executed, and the > following functions will not be registered at all. > The way to fix this is adding the parameter /B for EXIT command(EXIT /B > %ret_code%), which makes the EXIT only affect the current .bat script and > return to the caller script or cmd.exe window. -- This message was sent by Atlassian Jira (v8.20.1#820001)