Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell" #15

Open
jowens opened this issue Jul 21, 2017 · 1 comment

Comments

@jowens
Copy link

jowens commented Jul 21, 2017

@aberezin raised the following issue last year (bdrister#4)

On an unrelated topic, I have been seeing this error/clutter in the non-terminal output
bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell

I confirm the same (OS X, GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.4.0)). (This version of bash allows bash-completion, which is a nice feature.) Would love to see this fixed!

@demitri
Copy link

demitri commented May 9, 2019

I've been curious about this as well. A quick Google search turned this up:

https://emacs.stackexchange.com/questions/3447/cannot-set-terminal-process-group-error-when-running-bash-script

In the file DTRunManager.m is this method:

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

I removed the @"-i" option in the first return statement, ran the project, and the error lines disappeared. I barely did any testing so I don't know what other consequences this might have, but it worked for me.

Note that I am running bash built from source (GNU bash, version 4.4.18(1)-release) instead of using the system provided bash.

A little further reading here on bash interactive shells and the bash reference. From my cursory look at the DTerm code, it looks like each command in the DTerm window is sent directly to bash with the -c flag (as above) where the command is sent as a string as bash in invoked, meaning that this is not an interactive shell and -i is not appropriate here. A new bash shell is created each time. This was trivially tested by executing these commands consecutively in DTerm:

export DTEST=abc
echo $DTEST

The result was blank suggesting two (non-interactive) shells were involved. I assume that the -i should then be removed from both return statements. (It’s dangerous for me to start learning this code as I love DTerm and will then be tempted to work on it!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants