Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 802900

Summary: app-misc/mc fails if export TERM="xterm"
Product: Gentoo Linux Reporter: Benny Pedersen <me>
Component: Current packagesAssignee: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Status: RESOLVED INVALID    
Severity: normal CC: marecki, slashbeast
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info

Description Benny Pedersen 2021-07-19 11:02:46 UTC
use flag edit is not working if TERM="xterm", then F2 to F9 is not working at all

so mc meny sets is require linux to work

Reproducible: Always

Steps to Reproduce:
1. export TERM="xterm"
2. mc
3. press F4
Actual Results:  
noting happens

Expected Results:  
edit the current selected file

fun part there is F1 and F10 works
Comment 1 Marek Szuba (RETIRED) archtester gentoo-dev 2021-07-19 11:24:34 UTC
What terminal?
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-07-19 13:11:13 UTC
Please also add the output of

  emerge --info app-misc/mc

as comment to this bug.
Comment 3 Benny Pedersen 2021-07-19 13:33:21 UTC
Created attachment 725164 [details]
emerge --info

as requested

TERM="xterm" fails on menu keys, only TERM="linux" works
Comment 4 Marek Szuba (RETIRED) archtester gentoo-dev 2021-07-19 13:48:31 UTC
Ooookay, where to start.

One, if you start with TERM=linux that means you are on a Linux text console - which quite definitely is NOT an X terminal of any sort.

Two, having just reproduced the "problem" by logging in on tty2, seting TERM=xterm and running Midnight Commander, I could also see that "Esc 2", "Esc 3" and so on continued to work fine in spite of corresponding Function keys not being recognised - meaning that the problem clearly lies not with mc itself but with the terminal's inability to generate appropriate codes.

Three, terminals are in general supposed to set TERM to a correct value by themselves and changing this by hand is something one does at one's own risk.