# TikZ arrow tips on every subpath?

I would like to draw a single path with relative coordinates, where every segment gets their arrow tips. I have tried

\draw[<->] (0,0) -- ++(1,0) -- ++(1,0) -- ++(1,0);


But of course, as is specified in the manual, this adds arrow tips to the first and last subpaths only, of course, so it becomes something like <------------>, whereas I would like it to be <---><---><--->. I have read Drawing an arrow tip to every node of a path and know that an edge will give me arrow tips on every edge, but then I can't use incremental coordinates. (I am actually trying to do the exact same thing that @quinmars is doing in that question.)

Since the answer to that question is 5 years old, I was hoping that either TikZ or somebody else may have an elegant solution to this?

For straight lines only, maybe a bit like this?

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations}
\pgfdeclaredecoration{arrows}{draw}{
\state{draw}[width=\pgfdecoratedinputsegmentlength]{%
\path [every arrow subpath/.try] \pgfextra{%
\pgfpathmoveto{\pgfpointdecoratedinputsegmentfirst}%
\pgfpathlineto{\pgfpointdecoratedinputsegmentlast}%
};
}}
\tikzset{every arrow subpath/.style={->, draw, thick}}
\begin{document}
\begin{tikzpicture}
\path [decoration=arrows, decorate](0,0) -- ++(1,0) -- ++(0,1) -- ++(45:1);
\end{tikzpicture}
\end{document}


• I think the OP wants to have arrows on both ways: not like --->--->---> but like <----><----><---->. – Guilherme Zanotelli Sep 27 '16 at 19:10
• Just replace "->" in the .style with "<->". – Derek Sep 27 '16 at 20:08
• It there a way to modify this so that styles declared on the \path are inherited? For example, so that \path [decoration=arrows, decorate, green] would make the path green? – Jason Siefken Jul 7 '19 at 17:31