Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd2b3869 authored by Ng Zhi An's avatar Ng Zhi An
Browse files

Remove settitle

settitle always had a bug in the PROMPT_COMMAND, it used "\033]0;",
where it should be "\033[0m". It was opt-in, and changed to opt-out, and
no one really complained that it didn't work. So we are just going to
remove this.

References:
- http://www.termsys.demon.co.uk/vtansi.htm
- https://en.wikipedia.org/wiki/ANSI_escape_code

Test: lunch and see no change in prompt
Change-Id: I777c87b4d8e80c0e9437e5d2628f6df020883389
parent 36bf0df4
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -301,7 +301,6 @@ function printconfig()

function set_stuff_for_environment()
{
    settitle
    setpaths
    set_sequence_number

@@ -316,26 +315,6 @@ function set_sequence_number()
    export BUILD_ENV_SEQUENCE_NUMBER=13
}

function settitle()
{
    # This used to be opt-out with STAY_OFF_MY_LAWN, but this breaks folks
    # actually using PROMPT_COMMAND (https://issuetracker.google.com/38402256),
    # and the attempt to set the title doesn't do anything for the default
    # window manager in debian right now, so switch it to opt-in for anyone
    # who actually wants this.
    if [ "$ANDROID_BUILD_SET_WINDOW_TITLE" = "true" ]; then
        local arch=$(gettargetarch)
        local product=$TARGET_PRODUCT
        local variant=$TARGET_BUILD_VARIANT
        local apps=$TARGET_BUILD_APPS
        if [ -z "$apps" ]; then
            export PROMPT_COMMAND="echo -ne \"\033]0;[${arch}-${product}-${variant}] ${USER}@${HOSTNAME}: ${PWD}\007\""
        else
            export PROMPT_COMMAND="echo -ne \"\033]0;[$arch $apps $variant] ${USER}@${HOSTNAME}: ${PWD}\007\""
        fi
    fi
}

function addcompletions()
{
    local T dir f