flozz / nautilus-terminal

A terminal embedded in Nautilus, the GNOME's file browser
GNU General Public License v3.0
323 stars 24 forks source link

Detect if shell is running inside nautilus terminal #77

Closed jtsagata closed 2 years ago

jtsagata commented 2 years ago

Provide some way, maybe an ENV variable so you can change things if running inside the embeded terminal.

Possible use: Change the color scheme

flozz commented 2 years ago

Hello,

There is already an INSIDE_NAUTILUS_PYTHON environment variable declared that you can use (see #61).

:)

blackdaemon commented 2 years ago

This does not work for me, this variable is not present. I am trying to avoid running termux while in the nautilus terminal so I put condition into my .bashrc to run tmux only if INSIDE_NAUTILUS_PYTHON is not defined. I also tried custom command 'INSIDE_NAUTILUS_PYTHON=1 /bin/bash' but this also does not work, the variable is not set. Even tried custom command 'export INSIDE_NAUTILUS_PYTHON=1; /bin/bash', also no success.

I fixed this for me by setting the environment variable as a parameter to spawn_sync call inside nautilus_terminal.py

flozz commented 2 years ago

Maybe something has changed in Nautilus Python :shrug:

Anyway, you can PR the change if you want :)

flozz commented 2 years ago

Released in Nautilus Terminal v4.0.6