Skip to content

Commit

Permalink
initialize mouseopt_enabled only when mouse enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
stsp committed Mar 29, 2024
1 parent 86e67c4 commit 68490a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int shell_permanent;
static int stepping;
static int mouse_en;
static int mouseopt_extctl;
static int mouseopt_enabled = 1;
static int mouseopt_enabled;

#define DEBUG 0

Expand Down Expand Up @@ -4478,6 +4478,7 @@ int main(int argc, const char *argv[], const char *envp[])
mouse_en = mouse_init();
if (mouse_en)
{
mouseopt_enabled = 1;
mouseopt_extctl = (opt == 2);
setenv("COMCOM_MOUSE", copt, 1);
}
Expand Down Expand Up @@ -4531,8 +4532,12 @@ int main(int argc, const char *argv[], const char *envp[])
if (!mouse_en && (v = getenv("COMCOM_MOUSE")) && v[0] >= '1')
{
mouse_en = mouse_init();
if (mouse_en && v[0] == '2')
mouseopt_extctl = 1;
if (mouse_en)
{
mouseopt_enabled = 1;
if (v[0] == '2')
mouseopt_extctl = 1;
}
}

if (shell_permanent && !disable_autoexec)
Expand Down

0 comments on commit 68490a3

Please sign in to comment.