Get argument from current URL in twig to generate a link with that argument I'm trying to get an argument from search page URL so that I can pass that argument to a link.
For example I have this URL for a search results page:
http://domain.com/site-search?search_api_fulltext=foo
And on that page I want to have a link that goes to:
http://domain.com/other-search?search_api_fulltext=foo

I've tried {{ url('&lt;current&gt;') }} but that only returns the domain and path, but not the arguments. I've been trying stuff like {{ app.request.requestUri }} but that returns nothing.

FWIW, I'm trying to include these links in a custom block that appears on the search results page.
well if you are making a custom block then you are probably doing something like this .... 

 $build = [];
 $build['#theme'] = 'your_template',
 return $build;


and then in you hook_theme().

 hook_theme() {
  return [
   'your_template' =&gt; [
     'render element' =&gt; 'children',
     'template' = 'your-templante-name',
    ],
  ];
 }


you don't need to pre prossess the block at all just make sure the block is not being cached aka add this to your block plugin. 

see How to prevent a block from being cached?

public function getCacheMaxAge() {
  return 0;
}


then in your block function :

 $search_query = \Drupal::request()-&gt;get('search_api_fulltext');
 $build = [];
 $build['#theme'] = 'your_template',
 $build['#search_query'] =  $search_query,
 return $build;
....


 hook_theme() {
  return [
   'your_template' =&gt; [
     'render element' =&gt; 'children',
     'template' = 'your-templante-name',
     'variables' =&gt; [
       'search_query' =&gt; NULL,
     ],
    ],
  ];
 }


then in your twig template 

{% if search_query %}
  do what you want here {{search_query}}
{% endif%}