Bug 10938

Summary: non-deterministic oe-terminal spawning
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: coreAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher
Version: 2.3   
Target Milestone: 2.3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Juro Bystricky 2017-01-17 18:30:19 UTC
when running commands requiring terminal window (devshell, menuconfig),
with terminal setting set to "auto", we may get a different terminal each time we repeat the command.  
I believe the reason is we try to spawn a terminal based on a hard coded priority.
Providing the user does not have "tmux" installed (which is more likely than not), we spawn randomly one of the Konsole, Mate, Terminology, Gnome or Xfce.
These have all the same priority set to 2 and so ordering by priority can/will result in a different order.
This can be verified by printouts, running the same command first I obtained the list:

<class 'oe.terminal.Custom'>,
<class 'oe.terminal.TmuxRunning'>, 
<class 'oe.terminal.TmuxNewWindow'>, 
<class 'oe.terminal.Mate'>, 
<class 'oe.terminal.Terminology'>, 
<class 'oe.terminal.Konsole'>, 
<class 'oe.terminal.Xfce'>, 
<class 'oe.terminal.Gnome'>, 
<class 'oe.terminal.XTerm'>, 
<class 'oe.terminal.Rxvt'>, 
<class 'oe.terminal.Tmux'>, 
<class 'oe.terminal.Screen'>]
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "custom"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: No custom terminal (OE_TERMINAL_CUSTOMCMD) set
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-running"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-new-window"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "mate"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "terminology"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "konsole"

running the second time I got:
<class 'oe.terminal.Custom'>, 
<class 'oe.terminal.TmuxRunning'>, 
<class 'oe.terminal.TmuxNewWindow'>, 
<class 'oe.terminal.Xfce'>, 
<class 'oe.terminal.Mate'>, 
<class 'oe.terminal.Gnome'>, 
<class 'oe.terminal.Konsole'>, 
<class 'oe.terminal.Terminology'>, 
<class 'oe.terminal.Rxvt'>, 
<class 'oe.terminal.XTerm'>, 
<class 'oe.terminal.Tmux'>, 
<class 'oe.terminal.Screen'>]
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "custom"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: No custom terminal (OE_TERMINAL_CUSTOMCMD) set
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-running"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "tmux-new-window"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "xfce"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "mate"
DEBUG: zephyr-philosophers-1.6.0-r0 do_menuconfig: Attempting to spawn terminal "gnome"


So the first time menuconfig popped up in konsole and the second time in gnome.
BTW "Screen" does not seem to have any priority set, so it probably defaults to 0.
Comment 1 Juro Bystricky 2017-04-10 21:56:00 UTC
sent a patch to the mailing list:
http://lists.openembedded.org/pipermail/openembedded-core/2017-April/135463.html