Warp icon indicating copy to clipboard operation
Warp copied to clipboard

shell function doesn't be automatically completed by tab

Open ruukina opened this issue 1 year ago • 4 comments

Discord username (optional)

No response

Describe the bug

Created shell functions or command aliases in Warp envrionment cannot be completed by tab. Issue is on both of Mac OS and Linux version.

To reproduce

  1. Run Warp
  2. Create a shell function, for example,
~
$ function test_fn
function> ls
~
  1. Type test and push the TAB
  2. Can confirm there's no test_fn in candidate list

Expected behavior

Shell function or aliased command should be appear as candidate when doing TAB auto completioin Note that

  • No issue if invoking the function by fully typing the test_fn manually with Enter.
  • No issue at all with other terminal programs such as Mac OS's terminal or Gnome terminal of Linux

Screenshots

No response

Operating system

MacOS

Operating system and version

14.4.1

Shell Version

No response

Current Warp version

v0.2024.04.16.08.02.stable_00

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

ruukina avatar Apr 21 '24 05:04 ruukina

Hi @ruukina since Warp should load the completion for the function if you put in to your rc file (i.e.~/.zshrc) and load a new session (window/tab/pane).

CleanShot 2024-04-26 at 17 13 00

dannyneira avatar Apr 26 '24 23:04 dannyneira

@dannyneira , thank you for your comment. But unfortunately, it cannot be a solution. Not all shell functions or aliases are "static".

For example, Google provides "lunch" as a shell function when building AOSP. But even if you did "source build/envsetup.sh", which defines the "lunch", on Warp, you cannot find "lunch" from Warp's auto completion candidate list. Not only "lunch", evnsetup.sh provides number of functions for development convenience.

ruukina avatar Apr 29 '24 02:04 ruukina

@ruukina thanks for your patience. there is no fix for dynamically updating shell functions to be loaded on the fly in Warp. Your best bet is to fallback to shell completions by running your preferred shell zsh, bash, fish`, in a subshell.

dannyneira avatar Jun 28 '24 20:06 dannyneira

We are tracking shell completion request here: https://github.com/warpdotdev/Warp/discussions/434

dannyneira avatar Jun 28 '24 20:06 dannyneira