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

Fix for dumb or unset TERM #2

Closed
wants to merge 1 commit into from
Closed

Conversation

tdaitx
Copy link
Contributor

@tdaitx tdaitx commented May 5, 2015

This is a fix for when $TERM is unset or set to dumb - eg. the dumb value is used by scp. For some reason clear complains that the TERM variable is not properly set (it is) and causes an error:

$ scp <file> root@dietpi
TERM environment variable not set.
 --------------------------------

With the fix I am able to properly copy the file. I'm using the openssh-server package, I haven't tested it with the default dropbear.

Note that only exporting TERM is not enough, all output should be disabled otherwise scp will fail.

Reference:
export TERM=${TERM:-dumb}

@@ -56,6 +56,11 @@
#/////////////////////////////////////////////////////////////////////////////////////
# Main Loop
#/////////////////////////////////////////////////////////////////////////////////////
export TERM=${TERM:-dumb}
if (( "$TERM" == "dumb" )); then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exit also gets triggered with dropbear logins.

Heres the value of TERM:
export TERM=${TERM:-dumb}; echo -e "$TERM"
xterm

I tested with the following, exit doesnt get triggered with dropbear:
if [ "$TERM" = "dumb" ]; then

Tested with the following to confirm trigger works (exit got triggered):
if [ "$TERM" = "xterm" ]; then

If you can test with openssh server, just to verify:
if [ "$TERM" = "dumb" ]; then

Thanks tdaitx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exit is triggered on scp with openssh server and not triggered on the usual ssh login (just it should be). Thanks!

@Fourdee Fourdee closed this May 6, 2015
@Fourdee Fourdee reopened this May 6, 2015
@Fourdee
Copy link
Collaborator

Fourdee commented May 6, 2015

Thanks tdaitx,

I'll add this to the master branch manually. I'am unable to change/modify the code in this request as i dont have access to "patch-2".

Also moved to the login script line 39. This should prevent any further SCP connection issues down the road.
https://github.com/Fourdee/DietPi/blob/master/dietpi/login

@Fourdee Fourdee closed this May 6, 2015
rhkean added a commit to rhkean/DietPi that referenced this pull request Apr 13, 2016
Fourdee pushed a commit that referenced this pull request Oct 7, 2017
Updating Testing with Main Distro
@pedrom34 pedrom34 mentioned this pull request Jan 12, 2018
@m1saka m1saka mentioned this pull request Jan 23, 2018
Fourdee pushed a commit that referenced this pull request Jul 7, 2018
This was referenced Oct 14, 2020
@brianlinuxing brianlinuxing mentioned this pull request Dec 30, 2020
StephanStS added a commit that referenced this pull request Feb 18, 2021
StephanStS added a commit that referenced this pull request Feb 18, 2021
Link changed from phpBB to dietpi.com/docs #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants