Bash auto_completion with Xubuntu and xrdp from windows

31

You may find that this is a more general issue with interception of the Tab key under remote XFCE4 sessions, rather than a problem with bash completion itself.

I had a similar issue running XFCE4 over VNC and the workaround for me was to edit the ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml file to unset the following mapping

<       <property name="&lt;Super&gt;Tab" type="string" value="switch_window_key"/>
---
>       <property name="&lt;Super&gt;Tab" type="string" value="empty"/>

Note that there may be two entries, and the first already has the value "empty". If this is the case, edit the second entry.
I found this solution online somewhere and can't really take credit for it.

Share:
31

Related videos on Youtube

kemosabe
Author by

kemosabe

Updated on September 18, 2022

Comments

  • kemosabe
    kemosabe almost 2 years

    I am working with translations in Laravel and I have several arrays with translation keys that map to their corresponding translation. I need to remove any translation that has a -- and replace it with an empty string. I am already doing some other str-replacements in the same function so maybe I'm clobbering the function.

    Here is what the entire function looks like:

    public function getWithContext($locale, $context)
    {
        $this->registerContext($context);
    
        $contextKey = "{$locale}.{$context}";
    
        if ($this->has($contextKey)) return $this->get($contextKey);
    
        $out = [];
    
        $data = $this->get($locale);
    
        foreach ($data as $key => $value) {
            if (preg_match("/^({$context}\.)/", $key)) {
                $k       = str_replace("{$context}.", "", $key); 
                $out[$k] = ($value == "—-") ? "" : $value;
            }
        }
    
        if (!empty($out)) {
            $this->put($contextKey, new Collection($out));
        }
    
        return $out;
    }
    

    I'm trying to get the line $out[$k] = ($value == "--") ? "" : $value; to work specifically.

    • Gwendal
      Gwendal over 8 years
      What's not working ? Do you have an error, or is assignment not working ? What's in you $out var ?
    • kemosabe
      kemosabe over 8 years
      I wasn't getting an error, it just wasn't changing the dashes to an empty string as I expected it to. I posted what happened in an answer below. Thanks for asking and trying to help.
  • nik the lion
    nik the lion almost 11 years
    Good shot, but i found this issue also with google. This property has already this value at my xfce4-keyboard-shortcuts.xml by default. The link: codebangers.com/?p=134
  • nik the lion
    nik the lion almost 11 years
    Damn. I wounder why this value is by default "empty". Checked this with less and find a second entry. But this time with the value "switch_window_key". Changed > restart > works!!!! Thank you :)
  • Sohaib
    Sohaib almost 10 years
    @steeldriver I couldnt quite understand the change to be employed can I have a little more explanation?
  • Cameron Taggart
    Cameron Taggart over 8 years
    Edit that file and replace switch_window_key with empty on that line. I used nano to edit the file. I then restarted VNC with sudo service vncserver restart. It just worked for me.
  • kemosabe
    kemosabe over 8 years
    That's exactly the problem!
  • Jon Carter
    Jon Carter almost 7 years
    I was sure this was an RDP issue. I was wrong. Thanks for this.
  • fIwJlxSzApHEZIl
    fIwJlxSzApHEZIl about 6 years
    this did not fix the issue for me when using XRDP and XFCE4. I had one entry up top set to switch_window_key and another down below set to empty. I set the first entry for Super&gt;Tab to empty and did sudo xrdp restart and re-logged in to no change.