44// file that was distributed with this source code.
55
66use crate :: header:: Header ;
7- use crate :: picker:: { get_cgroup , get_command} ;
7+ use crate :: picker:: get_command;
88use crate :: platform:: get_numa_nodes;
99use crate :: tui:: stat:: { CpuValueMode , TuiStat } ;
1010use crate :: Filter :: { EUser , User } ;
@@ -98,6 +98,7 @@ pub fn handle_input(
9898 data. write ( ) . unwrap ( ) . 1 = ProcList :: new ( settings, & tui_stat. read ( ) . unwrap ( ) ) ;
9999 should_update. store ( true , Ordering :: Relaxed ) ;
100100 }
101+ #[ cfg( target_os = "linux" ) ]
101102 Event :: Key ( KeyEvent {
102103 code : KeyCode :: Char ( 'g' ) ,
103104 modifiers : KeyModifiers :: CONTROL ,
@@ -121,7 +122,7 @@ pub fn handle_input(
121122 pid,
122123 get_command( pid, false )
123124 ) ;
124- let content = get_cgroup ( pid) ;
125+ let content = crate :: picker :: get_cgroup ( pid) ;
125126 data. 2 = Some ( InfoBar { title, content } ) ;
126127 }
127128 should_update. store ( true , Ordering :: Relaxed ) ;
@@ -199,6 +200,35 @@ pub fn handle_input(
199200 stat. cpu_graph_mode = stat. cpu_graph_mode . next ( ) ;
200201 should_update. store ( true , Ordering :: Relaxed ) ;
201202 }
203+ #[ cfg( target_os = "linux" ) ]
204+ Event :: Key ( KeyEvent {
205+ code : KeyCode :: Char ( 'u' ) ,
206+ modifiers : KeyModifiers :: CONTROL ,
207+ ..
208+ } ) => {
209+ let mut data = data. write ( ) . unwrap ( ) ;
210+ if data. 2 . is_some ( ) {
211+ data. 2 = None ;
212+ } else {
213+ let tui_stat = tui_stat. read ( ) . unwrap ( ) ;
214+ let mut nth = tui_stat. list_offset ;
215+ if data. 1 . collected . is_empty ( ) {
216+ return false ;
217+ }
218+ if data. 1 . collected . len ( ) <= nth {
219+ nth = data. 1 . collected . len ( ) - 1 ;
220+ }
221+ let pid = data. 1 . collected [ nth] . 0 ;
222+ let title = format ! (
223+ "supplementary groups for pid {}, {}" ,
224+ pid,
225+ get_command( pid, false )
226+ ) ;
227+ let content = crate :: picker:: get_supplementary_groups ( pid) ;
228+ data. 2 = Some ( InfoBar { title, content } ) ;
229+ }
230+ should_update. store ( true , Ordering :: Relaxed ) ;
231+ }
202232 char !( 'U' ) => {
203233 let mut stat = tui_stat. write ( ) . unwrap ( ) ;
204234 stat. input_label = "Which user (blank for all) " . into ( ) ;
0 commit comments