This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.6
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/branch-1.6 by this push:
     new a4d2f72f7 [KYUUBI #3598] Beeline doesn't work with -e option when 
started in background
a4d2f72f7 is described below

commit a4d2f72f768fe1be44a3c6029e4279188402d4d7
Author: zhouyifan279 <[email protected]>
AuthorDate: Sun Oct 9 22:03:25 2022 +0800

    [KYUUBI #3598] Beeline doesn't work with -e option when started in 
background
    
    ### _Why are the changes needed?_
    Fix #3598
    
    Hive Beeline has the same issue: 
https://issues.apache.org/jira/browse/HIVE-6758 and was fixed by append jline 
option "-Djline.termial=jline.UnsupportedTerminal".
    
    We do the same in this PR.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [x] Add screenshots for manual tests if appropriate
    <img width="1043" alt="image" 
src="https://user-images.githubusercontent.com/88070094/194760564-04258a46-646f-4f76-ab19-b3e305b0ef69.png";>
    
    - [ ] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #3599 from zhouyifan279/3598.
    
    Closes #3598
    
    3c11d27c [zhouyifan279] improve indent
    6d39b3cc [zhouyifan279] Beeline doesn't work with -e option when started in 
background
    
    Authored-by: zhouyifan279 <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit 055fb22fb55ff8a2be9421ad82dec851a03f8c3a)
    Signed-off-by: Cheng Pan <[email protected]>
---
 bin/beeline | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/beeline b/bin/beeline
index 91e6654bf..3581f6dd6 100755
--- a/bin/beeline
+++ b/bin/beeline
@@ -30,6 +30,11 @@ fi
 
 RUNNER="${JAVA_HOME}/bin/java"
 
+# Append jline option to enable the Beeline process to run in background.
+if [[ ( ! $(ps -o stat= -p $$) =~ "+" ) && ! ( -p /dev/stdin ) ]]; then
+  export KYUUBI_BEELINE_OPTS="$KYUUBI_BEELINE_OPTS 
-Djline.terminal=jline.UnsupportedTerminal"
+fi
+
 ## Find the Kyuubi beeline Jar
 if [[ -z "$KYUUBI_BEELINE_JARS" ]]; then
   KYUUBI_BEELINE_JARS="$KYUUBI_HOME/beeline-jars"

Reply via email to