Skip to content

fish: TERM environment variable not set #16

Open
@ethanliu

Description

I think it more about sandboxing issue while fish shell can't get $TERM env.
fish global config (/usr/local/etc/fish/config.fish) and --init-command both not working as expect.

disable interactive mode to get rid of warning message seems works fine

DTRunManager.m

+ (NSArray*)argumentsToRunCommand:(NSString*)command {
    NSString* shell = [[DTRunManager shellPath] lastPathComponent];
    
    if([shell isEqualToString:@"bash"] || [shell isEqualToString:@"sh"])
        return @[@"-l", @"-i", @"-c", command];
    else if([shell isEqualToString:@"fish"])
        return @[@"-c", command];
    else
        return @[@"-i", @"-c", command];
}

Partial of the debug result with fish shell under NSTask or Process in swift

<2> fish: init_locale() setlocale(): 'C'
<2> fish: curses var TERM=''
<2> fish: curses var TERMINFO=''
<2> fish: curses var TERMINFO_DIRS=''
<W> fish: Could not set up terminal.
<W> fish: TERM environment variable not set.
<W> fish: Using fallback terminal type 'ansi'.
<2> fish: 256 color support: using 8 colors per terminfo
<2> fish: curses var TERM='ansi'
<2> fish: curses var TERMINFO=''
<2> fish: curses var TERMINFO_DIRS=''
<2> fish: 256 color support: using 8 colors per terminfo
<2> fish: sourcing /usr/local/share/fish/config.fish

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions