The TERM variable is not set to xterm-256color

Bug #1366485 reported by Paride Legovini on 2014-09-07
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sakura
High
David Gómez

Bug Description

Hello,

With sakura 3.1.5 I was expecting TERM to be set to xterm-256color by default, but I noticed that this is not happening: I get TERM=xterm as before. I see that now in sakura.c we have

g_setenv("TERM", "xterm-256color", FALSE);

where that FALSE means that the variable is not overwritten. My guess is that something else is setting the TERM variable, and it is not my shell. I think it is libvte, as here

https://developer.gnome.org/vte/unstable/VteTerminal.html

I read:

vte_terminal_spawn_sync ()
[...] The "TERM" environment variable is automatically set to a default value, but can be overridden from envv.

Now I see that sakura does not call that function, at least not directly, but still I think it may be vte that sets TERM.

I hope this can be fixed.
Thanks!

Von Random (vdrandom) wrote :

- g_setenv("TERM", "xterm-256color", FALSE);
+ g_setenv("TERM", "xterm-256color", TRUE);

does not help sadly.

David Gómez (dabisu) on 2014-11-21
Changed in sakura:
importance: Undecided → High
assignee: nobody → David Gómez (dabisu)
status: New → Confirmed
David Gómez (dabisu) wrote :

Yes, it seems libvte overwrites the TERM variable. I tried passing the TERM variable in the environment variable array when the vte terminal is created, but that gets overwriten too. I'm looking now at how to make libvte to not overwrite it, but if it is not possible i guess the only solution is to set the TERM variable in your shell init scripts.

David Gómez (dabisu) wrote :

Ok, it seems in the development version of vte (0.38.1) this is solved. The vte documentation for the function vte_terminal_spawm_sync says this "The "TERM" environment variable is automatically set to a default value, but can be overridden from envv".

But this version of vte is not compatible with previous versions and is still marked as development. Maybe is a bit too soon to port and release sakura based in this developtment version.

Paride Legovini (torn-b) wrote :

That is what I quoted in the first post :)
I agree with you in that the best option is to wait for a version of vte containing this feature to be officially released.

Paride Legovini (torn-b) wrote :

Dear David,

it seems that libvte 0.38.1 is now stable, and it is already included in Debian jessie.
Fixing this issue should finally be possible now!

David Gómez (dabisu) wrote :

I just uploaded to launchpad a sakura version ported to vte-2.91. I've not checked yet if the 256 colors are working ok, but at least now the TERM variable is correctly set ;)

David Gómez (dabisu) on 2015-07-25
Changed in sakura:
status: Confirmed → Fix Committed

Great, David! I just compiled it and everything is working fine.
Now we're looking forward to a release!

David Gómez (dabisu) on 2015-07-30
Changed in sakura:
status: Fix Committed → Fix Released

It might also make sense to have sakura set COLORTERM to "sakura" or something, since there seems to be a convention for doing that (gnome-terminal sets it to gnome-terminal, xfce4-terminal sets it to xfce4-terminal etc.), which would let people make sakura-specific bashrc settings.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions