After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769792 - provide a terminal export variable to track if inside builder
provide a terminal export variable to track if inside builder
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: plugins
3.21.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-12 10:36 UTC by Mohammed Sadiq
Modified: 2016-09-16 05:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
terminal: Add INSIDE_GNOME_BUILDER (2.39 KB, patch)
2016-09-13 12:15 UTC, Garrett Regier
none Details | Review
terminal: Add INSIDE_GNOME_BUILDER v2 (1.31 KB, patch)
2016-09-16 04:39 UTC, Garrett Regier
committed Details | Review

Description Mohammed Sadiq 2016-08-12 10:36:05 UTC
It might be good to provide a variable (like 'INSIDE_BUILDER') when terminal emulator is run inside builder.

Editors like GNU Emacs do that. Emacs sets a variable 'INSIDE_EMACS' so that any Emacs only changes (changes to shell when run inside Emacs) can use that variable to conditionally do things.

The usual use cases includes:
1. shorten PS1, as there is less space for term.
2. set variables like MALLOC_CHECK_, MALLOC_PERTURB_, etc.
Comment 1 Christian Hergert 2016-08-12 14:00:26 UTC
Seems reasonable to me.

The target code for this will be in plugins/terminal/gbp-terminal-view.c and look for vte_terminal_spawn_sync(). Currently we pass NULL for the environ, so we'll need to modify that.
Comment 2 Garrett Regier 2016-09-13 12:15:03 UTC
Created attachment 335437 [details] [review]
terminal: Add INSIDE_GNOME_BUILDER

This allows programs to detect when running inside Builder and perform version checks.
Comment 3 Christian Hergert 2016-09-13 16:45:00 UTC
Review of attachment 335437 [details] [review]:

LGTM
Comment 4 Garrett Regier 2016-09-16 04:39:53 UTC
Created attachment 335666 [details] [review]
terminal: Add INSIDE_GNOME_BUILDER v2

This allows programs to detect when running inside Builder and perform version checks.


Update due to recent changes.
Comment 5 Christian Hergert 2016-09-16 05:20:23 UTC
Review of attachment 335666 [details] [review]:

LGTM!
Comment 6 Garrett Regier 2016-09-16 05:23:11 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.